From: Sam Gross Date: Tue, 19 Sep 2023 17:35:11 +0000 (-0400) Subject: gh-108724: Fix _PySemaphore compile error on WASM (gh-109583) X-Git-Tag: v3.13.0a1~388 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9df6712c122b621dc5a1053ff1eccf0debfb2148;p=thirdparty%2FPython%2Fcpython.git gh-108724: Fix _PySemaphore compile error on WASM (gh-109583) Some WASM platforms have POSIX semaphores, but not sem_timedwait. --- diff --git a/Include/internal/pycore_semaphore.h b/Include/internal/pycore_semaphore.h index c1df83336290..2a4ecb7147ac 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