[Pythonmac-SIG] Python 2.2 Framework _REENTRANT
Jack Jansen
jack@oratrix.nl
Sat, 29 Dec 2001 17:21:05 +0100
You should probably compile without preprocessed headers (sorry, not
behind my OSX machine right now so I don't know the exact command line
switch).
The problem is that Python needs the _REENTRANT macro defined (for the
reason stated in pyconfig.h, so that you get thread-safe errno and
such), but that the set of precompile headers supplied by Apple was
generated with it undefined. This is a general problem with
precompiled headers: they only work if you don't use any special
switches.
Recently, Adam Eijdenberg <adam@switchedonsoftware.com> said:
> Hi,
>
> I'm developing a Mach-O Carbon application that embeds Python and I'm
> getting a few funny warnings when I try to compile it.
>
> I've installed the Unix version of Python with the commands "./configure
> --enable-framework && make && make framework" install as per
> documentation and that all seems to work fine.
>
> But when I compile my application with:
> cc *.c -framework Carbon -framework Python
>
> I get the following warnings: (widget.h is one of my files, line 6
> #includes <Python/Python.h>)
>
> widget.h:6: warning: could not use precompiled header
> '/System/Library/Frameworks/Carbon.framework/Headers/Carbon.p', because:
> widget.h:6: warning: #ifdef '_REENTRANT' not defined when precompiled,
> but now defined:
> widget.h:6: warning: at
> /Library/Frameworks/Python.framework/Headers/pyconfig.h:208
>
> Lines 207 and 208 in pyconfig.h are:
>
> /* Define to force use of thread-safe errno, h_errno, and other
> functions */
> #define _REENTRANT 1
>
> Commenting out this line removes all warnings.
>
> Everything seems to work fine, but could commenting this line out cause
> any problems?
>
> Kind regards,
> Adam Eijdenberg
>
> Switched on Software
> adam@switchedonsoftware.com
>
>
> _______________________________________________
> Pythonmac-SIG maillist - Pythonmac-SIG@python.org
> http://mail.python.org/mailman/listinfo/pythonmac-sig
>
--
Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++
Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++
www.cwi.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm