Fix usage of _GNU_SOURCE
authorDan Winship <danw@gnome.org>
Sun, 1 May 2011 15:17:14 +0000 (11:17 -0400)
committerDan Winship <danw@gnome.org>
Tue, 3 May 2011 11:07:41 +0000 (07:07 -0400)
commite56498ee0b1bdac0ad3c18a1f7bff83d4a5b1323
treef694051988dc519d24a235444b96284e56904799
parent33c0877adc681cb7cf8cf12afd94a9de8c869bf2
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
16 files changed:
configure.ac
gio/gfile.c
gio/glib-compile-schemas.c
gio/glocalfileinfo.c
gio/gnetworkingprivate.h
gio/gsettings.c
gio/gunixcredentialsmessage.c
gio/gunixfdlist.c
gio/libasyncns/g-asyncns.h
gio/tests/gdbus-peer.c
glib/glib-unix.h
glib/gmain.c
glib/gprintf.c
glib/gqsort.c
glib/gslice.c
glib/gstrfuncs.c