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

Re: Best test condition for defining _GNU_SOURCE?



On Thu, 2012-06-14 at 08:52 +0100, Samuel Thibault wrote:
> Svante Signell, le Thu 14 Jun 2012 09:46:14 +0200, a écrit :
> > Is the following construct OK?
> > #ifdef __GNUC__
> > #define _GNU_SOURCE
> > #endif
> 
> GNU C does not necessarily imply using the GLIBC. Defining _GNU_SOURCE
> all the time shouldn't hurt, however, so simply drop the #ifdef.

Yes, I know GNU C does not imply GLIBC usage. It was one kind of
solution, using __GNU__ (everywhere) another. I will define _GNU_SOURCE
unconditionally then and use the condition on GLIBC for the second.

A question: How does unconditionally defining _GNU_SOURCE affect
non_{GNUC,GLIBC} systems?



Reply to: