Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
_GNU_SOURCE macro is already defined in CPP and asprintf and vasprintf prototypes...
authorcherierm <cherierm@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 19 Aug 2008 16:09:52 +0000 (16:09 +0000)
committercherierm <cherierm@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 19 Aug 2008 16:09:52 +0000 (16:09 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@5899 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/portable.h

index f56b81d..aef3db0 100644 (file)
@@ -24,7 +24,9 @@
 
 /* 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
+#  ifndef _GNU_SOUCE
+#    define _GNU_SOURCE
+#  endif
 #  include <stdio.h>
 #endif
 
@@ -124,7 +126,7 @@ extern int portable_vsnprintf(char *str, size_t str_m, const char *fmt, va_list
 #endif
 
 /* prototype of GNU functions  */
-#if defined(__GNUC__)
+#if (defined(__GNUC__) && !defined(__cplusplus))
 extern int asprintf  (char **ptr, const char *fmt, /*args*/ ...);
 extern int vasprintf (char **ptr, const char *fmt, va_list ap);
 #endif