[Python-Dev] Problems with definition of _POSIX_C_SOURCE

Jack Jansen Jack.Jansen at cwi.nl
Thu Mar 17 00:01:35 CET 2005


On a platform I won't mention here I'm running into problems compiling 
Python, because of it defining _POSIX_C_SOURCE.

It turns out that on this platform the definition causes all sorts of 
declarations in sys/types.h to be skipped (presumably because they're 
not official Posix identifiers), which in turn causes platform-specific 
headers to fail.

The comment in pyconfig.h suggests that defining _POSIX_C_SOURCE may 
enable certain features, but the actual system headers appear to work 
the other way around: it seems that defining this will disable features 
that are not strict Posix.

Does anyone know what the real meaning of this define is? Because if it 
is the former then Python is right, but if it is the latter Python 
really has no business defining it: in general Python isn't 100% 
posix-compliant because it'll use all sorts of platform-dependent (and, 
thus, potentially non-posix-compliant) code...

This problem is currently stopping Python 2.4.1 to compile on this 
platform, so if anyone can provide any insight that would be very 
helpful...
--
Jack Jansen, <Jack.Jansen at cwi.nl>, http://www.cwi.nl/~jack
If I can't dance I don't want to be part of your revolution -- Emma 
Goldman



More information about the Python-Dev mailing list