[Python-Dev] Make _GNU_SOURCE default for gcc ?!

M.-A. Lemburg mal@lemburg.com
Tue, 04 Jul 2000 21:05:01 +0200


"Fred L. Drake, Jr." wrote:
> 
> M.-A. Lemburg writes:
>  > /* Enable compiler features including SUSv2 compatibility; switching
>  >    on C lib defines doesn't work here, because the symbols haven't
>  >    necessarily been defined yet. */
>  > #define _GNU_SOURCE     1
>  > #define _XOPEN_SOURCE   500
> ...
>  > Should I check this in ?
> 
>   This works for me; I presume you putting this before all other
> #includes?

Right. 

I've added some ifdefs just to make sure. This is how my
Python.h file looks now:

...
See the file "Misc/COPYRIGHT" for information on usage and
redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
******************************************************************/

/* Enable compiler features including SUSv2 compatibility; switching
   on C lib defines doesn't work here, because the symbols haven't
   necessarily been defined yet. */
#ifndef _GNU_SOURCE
# define _GNU_SOURCE	1
#endif
#ifndef _XOPEN_SOURCE
# define _XOPEN_SOURCE	500
#endif

/* Include nearly all Python header files */

#include "patchlevel.h"
#include "config.h"
...

Other opinions ?

-- 
Marc-Andre Lemburg
______________________________________________________________________
Business:                                      http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/