What GCC version had <stdint.h> defined?

Scott David Daniels Scott.Daniels at Acm.Org
Thu Aug 26 19:16:17 EDT 2004


Martin v. Löwis wrote:

> Scott David Daniels wrote:
> 
>> Does anyone know which version of GCC introduced stdint.h (and
>> thereby uintptr_t and intptr_t)?  I'd like to get the conditionals
>> right.
> 
> 
> stdint.h is not part of GCC; it is part of libc6. You shouldn't do
> #ifdefs based on version numbers, but instead, you should do checks
> based on the features of the software, like autoconf does.
> 
> Regards,
> Martin

Well, currently pyconfig.h for 2.4 says:
     ...
     #if _MSC_VER != 1200
     #define HAVE_UINTPTR_T 1
     #define HAVE_INTPTR_T 1
     #endif
     ...

which is actually a pretty low bar to get over.

I'd like to change it to something like:
     ...
     #if _MSC_VER > 1200
     #define HAVE_UINTPTR_T 1
     #define HAVE_INTPTR_T 1
     #endif
     ...
     #if GCC_VERSION >= 30100
     #define HAVE_UINTPTR_T 1
     #define HAVE_INTPTR_T 1
     #endif
     ...

which is arguably better even if not good enough.
Is there a better test I can do at compile time?

-Scott David Daniels
Scott.Daniels at Acm.Org



More information about the Python-list mailing list