summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorSam Gross <colesbury@gmail.com>2023-09-19 17:35:11 (GMT)
committerGitHub <noreply@github.com>2023-09-19 17:35:11 (GMT)
commit9df6712c122b621dc5a1053ff1eccf0debfb2148 (patch)
tree98432c1b43f55223449b15b00d21cdcba147fa7a /Include
parent0c89056fe59ac42f09978582479d40e58a236856 (diff)
downloadcpython-9df6712c122b621dc5a1053ff1eccf0debfb2148.zip
cpython-9df6712c122b621dc5a1053ff1eccf0debfb2148.tar.gz
cpython-9df6712c122b621dc5a1053ff1eccf0debfb2148.tar.bz2
gh-108724: Fix _PySemaphore compile error on WASM (gh-109583)
Some WASM platforms have POSIX semaphores, but not sem_timedwait.
Diffstat (limited to 'Include')
-rw-r--r--Include/internal/pycore_semaphore.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/Include/internal/pycore_semaphore.h b/Include/internal/pycore_semaphore.h
index c1df833..2a4ecb7 100644
--- a/Include/internal/pycore_semaphore.h
+++ b/Include/internal/pycore_semaphore.h
@@ -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