Skip to content

Commit a8bb9ff

Browse files
authored
[android] Android seems to support constexpr mutex with NDK 19c (at least) (#38686)
The usage of constexpr was disabled in 2016 in #2345, but using NDK 19c, it seems that the usage doesn't fail compiling at the moment.
1 parent 5b14bf9 commit a8bb9ff

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

include/swift/Runtime/MutexPThread.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,11 @@ typedef os_unfair_lock MutexHandle;
3737
typedef pthread_mutex_t MutexHandle;
3838
#endif
3939

40-
#if defined(__CYGWIN__) || defined(__ANDROID__) || defined(__HAIKU__) || defined(__wasi__)
40+
#if defined(__CYGWIN__) || defined(__HAIKU__) || defined(__wasi__)
4141
// At the moment CYGWIN pthreads implementation doesn't support the use of
4242
// constexpr for static allocation versions. The way they define things
43-
// results in a reinterpret_cast which violates constexpr. Similarly, Android's
44-
// pthread implementation makes use of volatile attributes that prevent it from
45-
// being marked as constexpr. WASI currently doesn't support threading/locking at all.
43+
// results in a reinterpret_cast which violates constexpr.
44+
// WASI currently doesn't support threading/locking at all.
4645
#define SWIFT_CONDITION_SUPPORTS_CONSTEXPR 0
4746
#define SWIFT_MUTEX_SUPPORTS_CONSTEXPR 0
4847
#define SWIFT_READWRITELOCK_SUPPORTS_CONSTEXPR 0

0 commit comments

Comments
 (0)