gh-108724: Fix _PySemaphore compile error on WASM (gh-109583)

Some WASM platforms have POSIX semaphores, but not sem_timedwait.
This commit is contained in:
Sam Gross 2023-09-19 13:35:11 -04:00 committed by GitHub
parent 0c89056fe5
commit 9df6712c12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,7 +20,8 @@
# error "Require native threads. See https://bugs.python.org/issue31370"
#endif
#if defined(_POSIX_SEMAPHORES) && (_POSIX_SEMAPHORES+0) != -1
#if (defined(_POSIX_SEMAPHORES) && (_POSIX_SEMAPHORES+0) != -1 && \
defined(HAVE_SEM_TIMEDWAIT))
# define _Py_USE_SEMAPHORES
# include <semaphore.h>
#endif