gmain: Define _GNU_SOURCE before including glibconfig.h
authorEmmanuele Bassi <ebassi@linux.intel.com>
Sat, 4 Sep 2010 17:15:15 +0000 (18:15 +0100)
committerEmmanuele Bassi <ebassi@linux.intel.com>
Sat, 4 Sep 2010 17:15:15 +0000 (18:15 +0100)
As it pulls in unistd.h from something else.

glib/gmain.c

index 933c04f..78de717 100644 (file)
  * MT safe
  */
 
+/* for pipe2; need to define it first to avoid
+ * other headers pulling in unistd.h
+ */
+#define _GNU_SOURCE
+
 #include "config.h"
 #include "glibconfig.h"
 
@@ -47,8 +52,6 @@
 #define G_MAIN_POLL_DEBUG
 #endif
 
-#define _GNU_SOURCE  /* for pipe2 */
-
 #include <signal.h>
 #include <sys/types.h>
 #include <time.h>