Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Mac does not find the prototype of getline
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Sat, 27 Oct 2007 22:12:40 +0000 (22:12 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Sat, 27 Oct 2007 22:12:40 +0000 (22:12 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@4925 48e7efb5-ca39-0410-a469-dd3cf9ba447f

include/xbt/str.h
src/xbt/xbt_str.c

index ba0a616..49e99fc 100644 (file)
 #include <stdarg.h> /* va_* */
 #include "xbt/misc.h"
 #include "xbt/dynar.h"
-
-/* KILLME: Malek, are you sure you need this? */
-#if defined(_WIN32)
-#include <stdio.h>
-#endif 
+#include <stdio.h> /* FILE for getline */
 
 SG_BEGIN_DECL()
 
@@ -54,7 +50,7 @@ XBT_PUBLIC(int) vasprintf (char **ptr, const char *fmt, va_list ap);
 XBT_PUBLIC(char*) bprintf   (const char*fmt, ...) _XBT_GNUC_PRINTF(1,2);
 
 /* the gettext function. It gets redefined here only if not yet available */
-#if defined(_WIN32) || !defined(__GNUC__) || defined(DOXYGEN)
+#if !defined(__USE_GNU) || defined(DOXYGEN)
 XBT_PUBLIC(long) getline(char **lineptr, size_t *n, FILE *stream);
 #endif
 
index 02ee5ab..90725f8 100644 (file)
@@ -395,6 +395,9 @@ char *xbt_str_join(xbt_dynar_t dyn, const char*sep) {
 }
    
 #if !defined(HAVE_GETLINE) || defined(DOXYGEN)
+/* prototype here, just in case */
+long getline(char **buf, size_t *n, FILE *stream);
+
 /** @brief Get a single line from the stream (reimplementation of the GNU getline)
  * 
  * This is a redefinition of the GNU getline function, used on platforms where it does not exists.