Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Define _GNU_SOURCE in xbt/misc.h, so that it's defined across full build.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Thu, 11 Oct 2012 14:10:14 +0000 (16:10 +0200)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Thu, 11 Oct 2012 15:33:29 +0000 (17:33 +0200)
include/simgrid_config.h.in
include/xbt/misc.h
src/simix/smx_user.c

index a12421b..c995230 100644 (file)
@@ -74,17 +74,14 @@ XBT_PUBLIC(void) sg_version(int *major,int *minor,int *patch);
 @simgrid_need_asprintf@
 @simgrid_need_vasprintf@
 
 @simgrid_need_asprintf@
 @simgrid_need_vasprintf@
 
+#include <stdio.h>  /* FILE, getline if it exists  */
+
 /* Use that config to declare missing elements */
 #ifdef SIMGRID_NEED_GETLINE
 #include <stdlib.h> /* size_t */
 /* Use that config to declare missing elements */
 #ifdef SIMGRID_NEED_GETLINE
 #include <stdlib.h> /* size_t */
-#include <stdio.h>  /* FILE*  */
 XBT_PUBLIC(long) getline(char **lineptr, size_t * n, FILE * stream);
 XBT_PUBLIC(long) getline(char **lineptr, size_t * n, FILE * stream);
-#else
-#ifndef _GNU_SOURCE
-       #define _GNU_SOURCE
-#endif
-#include <stdio.h>
 #endif
 #endif
+
 #include <stdarg.h>
 
 /* snprintf related functions */
 #include <stdarg.h>
 
 /* snprintf related functions */
index 5260bce..529bfc6 100644 (file)
@@ -9,6 +9,11 @@
 #ifndef XBT_MISC_H
 #define XBT_MISC_H
 
 #ifndef XBT_MISC_H
 #define XBT_MISC_H
 
+/* Define _GNU_SOURCE for getline, isfinite, etc. */
+#ifndef _GNU_SOURCE
+       #define _GNU_SOURCE
+#endif
+
 /* Attributes are only in recent versions of GCC */
 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4))
 # define _XBT_GNUC_PRINTF( format_idx, arg_idx )    \
 /* Attributes are only in recent versions of GCC */
 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4))
 # define _XBT_GNUC_PRINTF( format_idx, arg_idx )    \
index 50b6db4..2ad612d 100644 (file)
@@ -8,16 +8,6 @@
 #include "smx_private.h"
 #include "mc/mc.h"
 #include "xbt/ex.h"
 #include "smx_private.h"
 #include "mc/mc.h"
 #include "xbt/ex.h"
-
-#ifndef _SVID_SOURCE
-#  define _SVID_SOURCE    /* strdup() */
-#endif
-#ifndef _ISOC99_SOURCE
-#  define _ISOC99_SOURCE  /* isfinite() */
-#endif
-#ifndef _ISO_C99_SOURCE
-#  define _ISO_C99_SOURCE /* isfinite() */
-#endif
 #include <math.h>         /* isfinite() */
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix);
 #include <math.h>         /* isfinite() */
 
 XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix);