From cd452fb1544868630fb93c4ea5db3377cd806cd3 Mon Sep 17 00:00:00 2001 From: Sam Gross Date: Tue, 19 Sep 2023 13:35:11 -0400 Subject: [PATCH] gh-108724: Fix _PySemaphore compile error on WASM (gh-109583) Some WASM platforms have POSIX semaphores, but not sem_timedwait. --- Include/internal/pycore_semaphore.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Include/internal/pycore_semaphore.h b/Include/internal/pycore_semaphore.h index c1df8333629066..2a4ecb7147acee 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 #endif