Skip to content

Commit 9b45993

Browse files
committed
Issue python#9586: Merge
2 parents b829dea + 9866231 commit 9b45993

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ Core and Builtins
124124
Library
125125
-------
126126

127+
- Issue #9586: Redefine SEM_FAILED on MacOSX to keep compiler happy.
128+
127129
- Issue 10527: make multiprocessing use poll() instead of select() if available.
128130

129131
- Issue #16688: Fix backreferences did make case-insensitive regex fail on

Modules/_multiprocessing/semaphore.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,13 @@ semlock_release(SemLockObject *self, PyObject *args)
186186
#define SEM_GETVALUE(sem, pval) sem_getvalue(sem, pval)
187187
#define SEM_UNLINK(name) sem_unlink(name)
188188

189+
/* OS X 10.4 defines SEM_FAILED as -1 instead of (sem_t *)-1; this gives
190+
compiler warnings, and (potentially) undefined behaviour. */
191+
#ifdef __APPLE__
192+
# undef SEM_FAILED
193+
# define SEM_FAILED ((sem_t *)-1)
194+
#endif
195+
189196
#ifndef HAVE_SEM_UNLINK
190197
# define sem_unlink(name) 0
191198
#endif

0 commit comments

Comments
 (0)