From 74158e8b6d468ba3c5c65f4b0b10a8ff1567bdc6 Mon Sep 17 00:00:00 2001 From: Max Desiatov Date: Sat, 9 May 2020 17:57:51 +0100 Subject: [PATCH] [Runtime] Define WebAssembly/WASI MutexPThread macros as 0 --- include/swift/Runtime/MutexPThread.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/swift/Runtime/MutexPThread.h b/include/swift/Runtime/MutexPThread.h index 1b06a2977bd06..132c580013f4d 100644 --- a/include/swift/Runtime/MutexPThread.h +++ b/include/swift/Runtime/MutexPThread.h @@ -26,12 +26,12 @@ typedef pthread_cond_t ConditionHandle; typedef pthread_mutex_t MutexHandle; typedef pthread_rwlock_t ReadWriteLockHandle; -#if defined(__CYGWIN__) || defined(__ANDROID__) || defined(__HAIKU__) +#if defined(__CYGWIN__) || defined(__ANDROID__) || defined(__HAIKU__) || defined(__wasi__) // At the moment CYGWIN pthreads implementation doesn't support the use of // constexpr for static allocation versions. The way they define things // results in a reinterpret_cast which violates constexpr. Similarly, Android's // pthread implementation makes use of volatile attributes that prevent it from -// being marked as constexpr. +// being marked as constexpr. WASI currently doesn't support threading/locking at all. #define SWIFT_CONDITION_SUPPORTS_CONSTEXPR 0 #define SWIFT_MUTEX_SUPPORTS_CONSTEXPR 0 #define SWIFT_READWRITELOCK_SUPPORTS_CONSTEXPR 0