| /** |
| * This file has no copyright assigned and is placed in the Public Domain. |
| * This file is part of the mingw-w64 runtime package. |
| * No warranty is given; refer to the file DISCLAIMER.PD within this package. |
| */ |
| |
| #ifndef WIN32_LEAN_AND_MEAN |
| #define WIN32_LEAN_AND_MEAN |
| #endif |
| #include <windows.h> |
| #include <sect_attribs.h> |
| |
| const int __mingw_TLScallback_caller_provider = 1; |
| extern void (WINAPI *const __mingw_TLScallback_ptr)(HANDLE,DWORD,LPVOID); |
| static void WINAPI tls_callback(HANDLE handle, DWORD reason, LPVOID reserved) { __mingw_TLScallback_ptr(handle, reason, reserved); } |
| static _CRTALLOC(".CRT$XLD") const PIMAGE_TLS_CALLBACK tls_callback_ptr = tls_callback; |
| |
| /* Force tlssup.c (_tls_used symbol for .tls linker section) to be linked. */ |
| extern const IMAGE_TLS_DIRECTORY _tls_used; |
| static __attribute__((destructor)) void _include_tls_used(void) { asm volatile ("" :: "r" (&_tls_used)); } |