Skip to content

Commit 76da9a0

Browse files
Use defined(_POSIX_THREADS) to detect pthread support (#33609)
Co-authored-by: Ben Rimmington <[email protected]>
1 parent a350fb7 commit 76da9a0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

include/swift/Runtime/Mutex.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@
2020

2121
#include <type_traits>
2222

23-
#if (defined(__APPLE__) || defined(__linux__) || defined(__CYGWIN__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__HAIKU__))
23+
#if __has_include(<unistd.h>)
24+
#include <unistd.h>
25+
#endif
26+
27+
#if defined(_POSIX_THREADS)
2428
#include "swift/Runtime/MutexPThread.h"
2529
#elif defined(_WIN32)
2630
#include "swift/Runtime/MutexWin32.h"

0 commit comments

Comments
 (0)