Skip to content

Commit c3d5c3d

Browse files
committed
stdlib: fix THreadLocalStorage builds for Windows
Due to the build ordering, I didn't notice this earlier. The inclusion of the header would define the guard, preventing the needed definitions. Unconditionally define the functions to ensure that they are available.
1 parent 8788253 commit c3d5c3d

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

stdlib/public/stubs/ThreadLocalStorage.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,13 @@ void _stdlib_destroyTLS(void *);
2323
SWIFT_CC(swift) SWIFT_RUNTIME_STDLIB_API
2424
void *_stdlib_createTLS(void);
2525

26-
#ifndef SWIFT_THREAD_GETSPECIFIC
26+
#if defined(_WIN32) && !defined(__CYGWIN__)
2727

28-
# if defined(_WIN32) && !defined(__CYGWIN__)
29-
30-
# if defined(_M_IX86)
31-
typedef __stdcall void (*__swift_thread_key_destructor)(void *);
32-
# else
33-
typedef void (*__swift_thread_key_destructor)(void *);
34-
# endif
28+
typedef
29+
#if defined(_M_IX86)
30+
__stdcall
31+
#endif
32+
void (*__swift_thread_key_destructor)(void *);
3533

3634
static void
3735
#if defined(_M_IX86)
@@ -48,8 +46,6 @@ _stdlib_thread_key_create(__swift_thread_key_t * _Nonnull key,
4846
return *key != FLS_OUT_OF_INDEXES;
4947
}
5048

51-
# endif
52-
5349
#endif
5450

5551
#if SWIFT_TLS_HAS_RESERVED_PTHREAD_SPECIFIC

0 commit comments

Comments
 (0)