diff options
author | Richard Oudkerk <shibturn@gmail.com> | 2013-01-01 17:25:09 +0000 |
---|---|---|
committer | Richard Oudkerk <shibturn@gmail.com> | 2013-01-01 17:25:09 +0000 |
commit | 7450a81970c0906025fd92017b34676e70c5a767 (patch) | |
tree | 75c5a2ceec9071cb91a41ab6ad1e0171f8d0a661 | |
parent | 856cb0fc34d9b82594e7c0053535ea7df747b8ab (diff) | |
download | cpython-git-7450a81970c0906025fd92017b34676e70c5a767.tar.gz |
Issue #9586: Redefine SEM_FAILED on MacOSX to keep compiler happy.
-rw-r--r-- | Misc/NEWS | 2 | ||||
-rw-r--r-- | Modules/_multiprocessing/semaphore.c | 7 |
2 files changed, 9 insertions, 0 deletions
@@ -175,6 +175,8 @@ Core and Builtins Library ------- +- Issue #9586: Redefine SEM_FAILED on MacOSX to keep compiler happy. + - Issue 10527: make multiprocessing use poll() instead of select() if available. - Issue #16485: Fix file descriptor not being closed if file header patching diff --git a/Modules/_multiprocessing/semaphore.c b/Modules/_multiprocessing/semaphore.c index 5bda1ce12a..b9e8f345fb 100644 --- a/Modules/_multiprocessing/semaphore.c +++ b/Modules/_multiprocessing/semaphore.c @@ -197,6 +197,13 @@ semlock_release(SemLockObject *self, PyObject *args) #define SEM_GETVALUE(sem, pval) sem_getvalue(sem, pval) #define SEM_UNLINK(name) sem_unlink(name) +/* OS X 10.4 defines SEM_FAILED as -1 instead of (sem_t *)-1; this gives + compiler warnings, and (potentially) undefined behaviour. */ +#ifdef __APPLE__ +# undef SEM_FAILED +# define SEM_FAILED ((sem_t *)-1) +#endif + #ifndef HAVE_SEM_UNLINK # define sem_unlink(name) 0 #endif |