]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-108724: Fix _PySemaphore compile error on WASM (gh-109583)
authorSam Gross <colesbury@gmail.com>
Tue, 19 Sep 2023 17:35:11 +0000 (13:35 -0400)
committerGitHub <noreply@github.com>
Tue, 19 Sep 2023 17:35:11 +0000 (17:35 +0000)
Some WASM platforms have POSIX semaphores, but not sem_timedwait.

Include/internal/pycore_semaphore.h

index c1df8333629066aa536ef7db485157cedfb49bfe..2a4ecb7147acee5723aba8b76d86c6704f8cf3b4 100644 (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