xref: /reactos/sdk/lib/crt/startup/tlsmthread.c (revision 9592728f)
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 /*#ifndef WIN32_LEAN_AND_MEAN
9 #define WIN32_LEAN_AND_MEAN
10 #endif
11 #include <windows.h>*/
12 #include <stdlib.h>
13 #include <windef.h>
14 
15 int __mingwthr_key_dtor (DWORD key, void (*dtor)(void *));
16 int __mingwthr_remove_key_dtor (DWORD key);
17 
18 extern int ___w64_mingwthr_remove_key_dtor (DWORD key);
19 extern int ___w64_mingwthr_add_key_dtor (DWORD key, void (*dtor)(void *));
20 
21 
22 #ifndef _WIN64
23 extern int __mingw_usemthread_dll;
24 #endif
25 
26 int
27 __mingwthr_remove_key_dtor (DWORD key)
28 {
29 #ifndef _WIN64
30   if (!__mingw_usemthread_dll)
31 #endif
32      return ___w64_mingwthr_remove_key_dtor (key);
33 #ifndef _WIN64
34   return 0;
35 #endif
36 }
37 
38 int
39 __mingwthr_key_dtor (DWORD key, void (*dtor)(void *))
40 {
41   if (dtor)
42     {
43 #ifndef _WIN64
44       if (!__mingw_usemthread_dll)
45 #endif
46         return ___w64_mingwthr_add_key_dtor (key, dtor);
47     }
48   return 0;
49 }
50