From a9c0a5b31cccd1b15c6cf95ae3a20c0c6cc77fed Mon Sep 17 00:00:00 2001 From: Sam Gross Date: Tue, 19 Sep 2023 13:04:19 -0400 Subject: [PATCH] gh-108724: Fix _PySemaphore compile error on WASM 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