From e6a50b4cff693954278df4f26b46ac9abe689e79 Mon Sep 17 00:00:00 2001 From: mquinson Date: Sat, 27 Oct 2007 22:12:40 +0000 Subject: [PATCH] Mac does not find the prototype of getline git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@4925 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- include/xbt/str.h | 8 ++------ src/xbt/xbt_str.c | 3 +++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/include/xbt/str.h b/include/xbt/str.h index ba0a6168cf..49e99fcec9 100644 --- a/include/xbt/str.h +++ b/include/xbt/str.h @@ -14,11 +14,7 @@ #include /* va_* */ #include "xbt/misc.h" #include "xbt/dynar.h" - -/* KILLME: Malek, are you sure you need this? */ -#if defined(_WIN32) -#include -#endif +#include /* 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 diff --git a/src/xbt/xbt_str.c b/src/xbt/xbt_str.c index 02ee5ab6b4..90725f8410 100644 --- a/src/xbt/xbt_str.c +++ b/src/xbt/xbt_str.c @@ -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. -- 2.20.1