[Python-Dev] Re: [Python-checkins] python/dist/src/Python thread_pthread.h, 2.53, 2.53.4.1

"Martin v. Löwis" martin at v.loewis.de
Mon Mar 28 14:42:39 CEST 2005


Andrew MacIntyre wrote:
> This change has broken the build on FreeBSD 4.x for me:
> 
> gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -O3 -Wall 
> -Wstrict-prototypes -
> I. -I./Include  -DPy_BUILD_CORE -o Python/thread.o Python/thread.c
> In file included from Python/thread.c:101:
> Python/thread_pthread.h:19: syntax error
> *** Error code 1

This should be fixed now, please try again and report whether it
works.

It would be really nice if you could try to analyse such problems
deeper in the future. In this case, it would have helped if you
had reported that _POSIX_SEMAPHORES is defined as

#define _POSIX_SEMAPHORES

so that the #if line expands to

#if == -1

The standard solution in this case is to write

#if (_POSIX_SEMAPHORES+0) == -1

so that it expands to a binary add if _POSIX_SEMAPHORES really
is a number (as it should be, according to POSIX); if some system
incorrectly defines _POSIX_SEMAPHORES to empty, you get

#if (+0) == -1

which still should compile.

Regards,
Martin


More information about the Python-Dev mailing list