Python 2.2.1 on Solaris 2.5.1: compilation problem

Martin v. Löwis loewis at informatik.hu-berlin.de
Wed Apr 10 11:36:57 EDT 2002


Oleg Broytmann <phd at phd.pp.ru> writes:

>    Thank you very much for stepping in.
> 
>    It revealed that "destructor" was defined
> typedef void (*destructor)(PyObject *);
>    before.
> 
>    Not sure if I should report this as a bug.

That is a bug: All API in a header must start with a Py prefix to
avoid the kind of conflict you got.

Unfortunately, this probably cannot be fixed for 2.2; you'll have to
work around it locally. It is unfortunate that this wasn't changed in
the Grand Renaming - it sounds like rename3.h will be needed. (*)

You could also report this as a bug to Sun: 'destructor' is not an
identifier reserved for the implementation, so they should not use it
in their header. Indeed, Solaris 9 (and probably earlier) has

extern int pthread_key_create(pthread_key_t *, void (*)(void *));

Finally, you could report this as a GCC bug: they should fix the
system header via fixincludes. This is also the work-around which I'd
offer: copy pthread.h to .../gcc-lib/system/2.8.1/include/pthread.h,
and adjust the copy accordingly.

HTH,
Martin

(*) The other apparent fix is also not available: one could propose to
include pthread.h before Python.h, but the change in include order was
deliberate, so that the system headers could pick up any defines in
pyconfig.h.



More information about the Python-list mailing list