summaryrefslogtreecommitdiffstats
path: root/Modules/_multiprocessing/semaphore.c
diff options
context:
space:
mode:
authorRichard Oudkerk <shibturn@gmail.com>2013-01-01 17:40:58 (GMT)
committerRichard Oudkerk <shibturn@gmail.com>2013-01-01 17:40:58 (GMT)
commit950fab07aa7b0d1c664f32cd2cc3c443f816124a (patch)
tree5c8c3ac0a67f636d5a19d94569503a9a7520dbd8 /Modules/_multiprocessing/semaphore.c
parenta9bc1bf93b81eb35ec359311b5dd1064a6eac488 (diff)
parent9b4599322d66a177ca3a2c318b674aaac88d3c90 (diff)
downloadcpython-950fab07aa7b0d1c664f32cd2cc3c443f816124a.zip
cpython-950fab07aa7b0d1c664f32cd2cc3c443f816124a.tar.gz
cpython-950fab07aa7b0d1c664f32cd2cc3c443f816124a.tar.bz2
Issue #9586: Merge.
Diffstat (limited to 'Modules/_multiprocessing/semaphore.c')
-rw-r--r--Modules/_multiprocessing/semaphore.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Modules/_multiprocessing/semaphore.c b/Modules/_multiprocessing/semaphore.c
index ccd5f01..eb3fa0c 100644
--- a/Modules/_multiprocessing/semaphore.c
+++ b/Modules/_multiprocessing/semaphore.c
@@ -186,6 +186,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