[MINGW]
[reactos.git] / reactos / lib / 3rdparty / mingw / tlsmcrt.c
1 /**
2 * This file has no copyright assigned and is placed in the Public Domain.
3 * This file is part of the w64 mingw-runtime package.
4 * No warranty is given; refer to the file DISCLAIMER.PD within this package.
5 *
6 * Written by Kai Tietz <kai.tietz@onevision.com>
7 */
8
9 /* We support TLS cleanup code in any case. If shared version of libgcc is used _CRT_MT has value 1,
10 otherwise
11 we do tls cleanup in runtime and _CRT_MT has value 2. */
12 int _CRT_MT = 2;
13
14 // HACK around broken imports from libmingwex, until RosBE64 is updated
15 #ifdef _M_AMD64
16
17 #ifndef WIN32_LEAN_AND_MEAN
18 #define WIN32_LEAN_AND_MEAN
19 #endif
20 #include <windows.h>
21 #include <stdlib.h>
22
23 int __mingwthr_key_dtor (DWORD key, void (*dtor)(void *));
24 int __mingwthr_remove_key_dtor (DWORD key);
25
26 extern int ___w64_mingwthr_remove_key_dtor (DWORD key);
27 extern int ___w64_mingwthr_add_key_dtor (DWORD key, void (*dtor)(void *));
28
29 int
30 __mingwthr_remove_key_dtor (DWORD key)
31 {
32 return ___w64_mingwthr_remove_key_dtor (key);
33 }
34
35 int
36 __mingwthr_key_dtor (DWORD key, void (*dtor)(void *))
37 {
38 if (dtor)
39 return ___w64_mingwthr_add_key_dtor (key, dtor);
40
41 return 0;
42 }
43 #endif
44