From: mquinson Date: Fri, 23 Mar 2007 22:03:21 +0000 (+0000) Subject: load stdio.h with _GNU_SOURCE defined ASAP before some random other system header... X-Git-Tag: v3.3~2010 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/aa5a11b84f7953b5b030e9996c47b890b27785d6 load stdio.h with _GNU_SOURCE defined ASAP before some random other system header loads it without the extra definition, thus hiding getline git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@3350 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/portable.h b/src/portable.h index 589ce6b586..a4d4f349c5 100644 --- a/src/portable.h +++ b/src/portable.h @@ -21,6 +21,12 @@ # include "gras_config.h" #endif +/* Load this asap to make sure that GNU_SOURCE is defined on need when stdio gets loaded by some random system header */ +#ifdef HAVE_GETLINE +# define _GNU_SOURCE +# include +#endif + #include #ifdef HAVE_ERRNO_H @@ -73,11 +79,6 @@ # define O_BINARY 0 #endif -#ifdef HAVE_GETLINE -# define _GNU_SOURCE -# include -#endif - /**** **** Time handling ****/