[Runtime] Define WebAssembly/WASI MutexPThread macros as 0

This commit is contained in:
Max Desiatov
2020-05-09 17:57:51 +01:00
committed by GitHub
parent c70dce0226
commit 74158e8b6d

View File

@@ -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