Skip to content

Commit 4527c08

Browse files
committed
[Threading][Windows] More header file fixes.
rdar://90776105
1 parent 6f4d9cc commit 4527c08

File tree

1 file changed

+7
-3
lines changed
  • include/swift/Threading/Impl

1 file changed

+7
-3
lines changed

include/swift/Threading/Impl/Win32.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,18 @@ inline void once_impl(once_t &predicate, void (*fn)(void *), void *context) {
102102

103103
// .. Thread local storage ...................................................
104104

105-
#if __cplusplus >= 201103L || __has_feature(cxx_thread_local)
106-
#define SWIFT_THREAD_LOCAL thread_local
105+
#ifdef __clang__
106+
# if __has_feature(cxx_thread_local)
107+
# define SWIFT_THREAD_LOCAL thread_local
108+
# endif
109+
#elif __cplusplus >= 201103L
110+
# define SWIFT_THREAD_LOCAL thread_local
107111
#endif
108112

109113
#define SWIFT_TLS_DECLARE_DTOR(name) void NTAPI name(void *)
110114

111115
using tls_key = DWORD;
112-
using tls_dtor = void NTAPI (*)(void *);
116+
using tls_dtor = PFLS_CALLBACK_FUNCTION;
113117

114118
inline bool tls_alloc(tls_key &key, tls_dtor dtor) {
115119
key = FlsAlloc(dtor);

0 commit comments

Comments
 (0)