summaryrefslogtreecommitdiff
path: root/glib/glib-unix.h
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2011-05-01 11:17:14 -0400
committerDan Winship <danw@gnome.org>2011-05-03 07:07:41 -0400
commite56498ee0b1bdac0ad3c18a1f7bff83d4a5b1323 (patch)
treef694051988dc519d24a235444b96284e56904799 /glib/glib-unix.h
parent33c0877adc681cb7cf8cf12afd94a9de8c869bf2 (diff)
downloadglib-e56498ee0b1bdac0ad3c18a1f7bff83d4a5b1323.tar.gz
Fix usage of _GNU_SOURCE
_GNU_SOURCE must be defined before including any other (system) header, so defining it in glib-unix.h (and hoping no one has included anything else before that) is wrong. And the "#define _USE_GNU" workaround for this problem in gnetworkingprivate.h is even wronger (and still prone to failure anyway due to single-include guards). Fix this by defining _GNU_SOURCE in config.h when building against glibc. In theory this is bad because new releases of glibc may include symbols that conflict with glib symbols, which could then cause compile failures. However, most people only see new releases of glibc when they upgrade their distro, at which point they also generally get new releases of gcc, which have new warnings/errors to clean up anyway. https://bugzilla.gnome.org/show_bug.cgi?id=649201
Diffstat (limited to 'glib/glib-unix.h')
-rw-r--r--glib/glib-unix.h8
1 files changed, 0 insertions, 8 deletions
diff --git a/glib/glib-unix.h b/glib/glib-unix.h
index e72477852..c6eef4a52 100644
--- a/glib/glib-unix.h
+++ b/glib/glib-unix.h
@@ -26,10 +26,6 @@
* system, work around it here (or better, fix the system or tell
* people to use a better one).
*/
-#ifndef _GNU_SOURCE
-#define _G_GNU_SOURCE_TEMPORARILY_DEFINED
-#define _GNU_SOURCE
-#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
@@ -37,10 +33,6 @@
#include <sys/wait.h>
#include <stdlib.h>
#include <fcntl.h>
-#ifdef _G_GNU_SOURCE_TEMPORARILY_DEFINED
-#undef _GNU_SOURCE
-#undef _G_GNU_SOURCE_TEMPORARILY_DEFINED
-#endif
#include <glib.h>