Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Try to improve getline portability...
authoralegrand <alegrand@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 15 Dec 2009 16:33:01 +0000 (16:33 +0000)
committeralegrand <alegrand@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 15 Dec 2009 16:33:01 +0000 (16:33 +0000)
In the configure, you test for the presence of getline using
    #define _GNU_SOURCE
    #include <stdio.h>
So it is detected as functionnal on my machine (hardy) but if you do
not put these lines in simgrid_config.h it will break. The only thing
is that other headers may include stdio.h earlier in which case the
later _GNU_SOURCE will be useless... :(

git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@6893 48e7efb5-ca39-0410-a469-dd3cf9ba447f

include/simgrid_config.h.in

index 18e01d0..69df80b 100644 (file)
@@ -23,6 +23,9 @@
 /* Use that config to declare missing elements */
 #ifdef SIMGRID_NEED_GETLINE
 XBT_PUBLIC(long) getline(char **lineptr, size_t * n, FILE * stream);
+#else
+#define _GNU_SOURCE
+#include <stdio.h>
 #endif