[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Best test condition for defining _GNU_SOURCE?



* Svante Signell <svante.signell@telia.com> [120614 09:46]:
> I have submitted a patch that needs to be modified to define _GNU_SOURCE
> for definitions of various glibc functions, like get_current_dir_name,
> declared in unistd.h if _USE_GNU is defined. __USE_GNU is defined by
> using the feature macro _GNU_SOURCE.

Hopefully clear, I just want to stress one point: _GNU_SOURCE needs
to be defined before the first glibc header is included. Once anything
including features.h in some way is included, defining _GNU_SOURCE no
longer has any effect.

        Bernhard R. Link


Reply to: