Skip to content
  • Simon McVittie's avatar
    Clean up how we arrange for environ to be declared · 91ae697d
    Simon McVittie authored
    
    
    Annoyingly, the POSIX way to declare environ (as
    "extern char **environ") is a redundant declaration in glibc with
    _GNU_SOURCE; work around that.
    
    We also have a workaround for _NSGetEnviron() needing to be used
    instead of direct access to environ in at least some circumstances on
    Mac OS. Attempt to sync that up between all the files that use environ,
    consistently sorting the most special special-cases first (Windows
    for files that are compiled there, then Mac, then GNU, with
    lowest-common-denominator POSIX last).
    
    The affected files are already OS-specific, so I'm not bothering to
    introduce a nicer or higher-level API for this.
    
    Based on the best bits of an earlier patch from me, and an earlier
    patch from Thomas Zimmermann.
    
    Signed-off-by: default avatarSimon McVittie <simon.mcvittie@collabora.co.uk>
    Reviewed-by: default avatarThomas Zimmermann <tdz@users.sourceforge.net>
    Bug: https://bugs.freedesktop.org/show_bug.cgi?id=97357
    91ae697d