[Python-Dev] more-precise instructions for "Python.h first"?

Martin v. Löwis martin@v.loewis.de
02 Jun 2003 07:41:38 +0200


David Abrahams <dave@boost-consulting.com> writes:

>    "Since Python may define some pre-processor definitions which
>    affect the standard headers on some systems, you must include
>    Python.h or pyconfig.h (Python's configuration header), before any
>    standard headers are included."

Ok. I think this rule may break on SGI, where Python.h has

#if defined(__sgi) && defined(WITH_THREAD) && !defined(_SGI_MP_SOURCE)
#define _SGI_MP_SOURCE
#endif

Now, I have never seen an SGI machine in my life, and I have no idea
what _SGI_MP_SOURCE is. However it seems that it is important that
this is defined before stdio.h is included (or perhaps it was
important at some point in time).

Apart from that, I can't find any problems with that rule (but there
may be problems that I'm overlooking). I recommend that you follow
this rule, anyway; if you discover any problems by doing so, please
let us know.

Regards,
Martin