From 5afa6d4dcf6e11d2ba4c10fb4b9b860930130df8 Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Sat, 28 Nov 2009 10:44:20 +0000 Subject: Issue #7272, continued: don't re-use existing HAVE_BROKEN_POSIX_SEMAPHORES to indicate that semaphores aren't available; define a new variable POSIX_SEMAPHORES_NOT_ENABLED instead. --- Modules/_multiprocessing/multiprocessing.c | 4 ++-- Modules/_multiprocessing/multiprocessing.h | 2 +- configure | 4 ++-- configure.in | 4 ++-- pyconfig.h.in | 3 +++ setup.py | 2 +- 6 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Modules/_multiprocessing/multiprocessing.c b/Modules/_multiprocessing/multiprocessing.c index cb6725b..e867030 100644 --- a/Modules/_multiprocessing/multiprocessing.c +++ b/Modules/_multiprocessing/multiprocessing.c @@ -251,7 +251,7 @@ init_multiprocessing(void) PyModule_AddObject(module, "Connection", (PyObject*)&ConnectionType); #if defined(MS_WINDOWS) || \ - (defined(HAVE_SEM_OPEN) && !defined(HAVE_BROKEN_POSIX_SEMAPHORES)) + (defined(HAVE_SEM_OPEN) && !defined(POSIX_SEMAPHORES_NOT_ENABLED)) /* Add SemLock type to module */ if (PyType_Ready(&SemLockType) < 0) return; @@ -298,7 +298,7 @@ init_multiprocessing(void) Py_DECREF(temp); Py_DECREF(value); return; } \ Py_DECREF(value) -#if defined(HAVE_SEM_OPEN) && !defined(HAVE_BROKEN_POSIX_SEMAPHORES) +#if defined(HAVE_SEM_OPEN) && !defined(POSIX_SEMAPHORES_NOT_ENABLED) ADD_FLAG(HAVE_SEM_OPEN); #endif #ifdef HAVE_SEM_TIMEDWAIT diff --git a/Modules/_multiprocessing/multiprocessing.h b/Modules/_multiprocessing/multiprocessing.h index 7c98ca7..3dd0199 100644 --- a/Modules/_multiprocessing/multiprocessing.h +++ b/Modules/_multiprocessing/multiprocessing.h @@ -27,7 +27,7 @@ # include # include # include /* htonl() and ntohl() */ -# if defined(HAVE_SEM_OPEN) && !defined(HAVE_BROKEN_POSIX_SEMAPHORES) +# if defined(HAVE_SEM_OPEN) && !defined(POSIX_SEMAPHORES_NOT_ENABLED) # include typedef sem_t *SEM_HANDLE; # endif diff --git a/configure b/configure index a006a8e..9fd579a 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 76432 . +# From configure.in Revision: 76550 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for python 2.7. # @@ -23876,7 +23876,7 @@ if test $ac_cv_posix_semaphores_enabled = no then cat >>confdefs.h <<\_ACEOF -#define HAVE_BROKEN_POSIX_SEMAPHORES 1 +#define POSIX_SEMAPHORES_NOT_ENABLED 1 _ACEOF fi diff --git a/configure.in b/configure.in index 3bef205..044464f 100644 --- a/configure.in +++ b/configure.in @@ -3419,8 +3419,8 @@ int main(void) { AC_MSG_RESULT($ac_cv_posix_semaphores_enabled) if test $ac_cv_posix_semaphores_enabled = no then - AC_DEFINE(HAVE_BROKEN_POSIX_SEMAPHORES, 1, - [Define if the Posix semaphores do not work on your system]) + AC_DEFINE(POSIX_SEMAPHORES_NOT_ENABLED, 1, + [Define if POSIX semaphores aren't enabled on your system]) fi diff --git a/pyconfig.h.in b/pyconfig.h.in index 5900cb0..7541213 100644 --- a/pyconfig.h.in +++ b/pyconfig.h.in @@ -909,6 +909,9 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION +/* Define if POSIX semaphores aren't enabled on your system */ +#undef POSIX_SEMAPHORES_NOT_ENABLED + /* Defined if PTHREAD_SCOPE_SYSTEM supported. */ #undef PTHREAD_SYSTEM_SCHED_SUPPORTED diff --git a/setup.py b/setup.py index 75ff11f..d7ef51e 100644 --- a/setup.py +++ b/setup.py @@ -1316,7 +1316,7 @@ class PyBuildExt(build_ext): '_multiprocessing/socket_connection.c' ] if (sysconfig.get_config_var('HAVE_SEM_OPEN') and not - sysconfig.get_config_var('HAVE_BROKEN_POSIX_SEMAPHORES')): + sysconfig.get_config_var('POSIX_SEMAPHORES_NOT_ENABLED')): multiprocessing_srcs.append('_multiprocessing/semaphore.c') if sysconfig.get_config_var('WITH_THREAD'): -- cgit v0.12