Skip to content

Commit d0cc575

Browse files
authored
Avoid #including pthread.h when SWIFT_STDLIB_SINGLE_THREADED_RUNTIME is set (#40175)
1 parent 7cd5e5b commit d0cc575

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/swift/Runtime/ThreadLocalStorage.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ static_assert(std::is_same<__swift_thread_key_t, DWORD>::value,
116116
# define SWIFT_THREAD_GETSPECIFIC FlsGetValue
117117
# define SWIFT_THREAD_SETSPECIFIC(key, value) (FlsSetValue(key, value) == FALSE)
118118

119-
# else
119+
# elif !defined(SWIFT_STDLIB_SINGLE_THREADED_RUNTIME)
120120
// Otherwise use the pthread API.
121121
# include <pthread.h>
122122
# define SWIFT_THREAD_KEY_CREATE pthread_key_create

0 commit comments

Comments
 (0)