Skip to content
  • Dan Winship's avatar
    Fix usage of _GNU_SOURCE · e56498ee
    Dan Winship authored
    _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
    e56498ee