On Mon, Jan 12, 2009 at 11:29 AM, Ian Romanick <i...@freedesktop.org> wrote: > On Mon, Jan 12, 2009 at 07:53:44PM +0100, Julien Cristau wrote: >> On Mon, Jan 12, 2009 at 10:47:53 -0800, Ian Romanick wrote: >> >> > Does defining _GNU_SOURCE actually cause those other things to be >> > defined? What happens if there are places in the Mesa code that check >> > for, say, _POSIX_SOURCE to select a code path? I don't think anything >> > like that exists today, but I'd rather be safe than sorry. >> >> Apparently so, looking at <features.h>: > > But that presumes <features.h> will have been included before one of > the derived marcos is used. Imagine a source file that *starts* with: > > #if (defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200112L)) \ > || (defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 600)) > /* include some files */ > #else > /* include some different files */ > #endif > > If you just define _GNU_SOURCE on the compiler command line, this > test, which should work, breaks. I don't see what removing the > defines gains us, but I'm not passionate enough about it to argue it > further. *shrug*
Yeah, I hadn't really thought of that case. However, the _*_SOURCE macros aren't used in mesa currently. And if they were, I think it's reasonable to #include <features.h> prior to checking the feature test macros. If this really bothers people, though, I'll revert it. -- Dan ------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword _______________________________________________ Mesa3d-dev mailing list Mesa3d-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mesa3d-dev