[CRT] Remove mingwm10.dll usage in tls support code

CORE-15491
This commit is contained in:
Mark Jansen 2019-07-04 23:06:51 +02:00
parent 6ba611f39e
commit 28a0aa9ae8
No known key found for this signature in database
GPG key ID: B39240EE84BEAE8B
2 changed files with 0 additions and 41 deletions

View file

@ -20,11 +20,6 @@ extern int ___w64_mingwthr_add_key_dtor (DWORD key, void (*dtor)(void *));
#ifndef _WIN64
#define MINGWM10_DLL "mingwm10.dll"
typedef int (*fMTRemoveKeyDtor)(DWORD key);
typedef int (*fMTKeyDtor)(DWORD key, void (*dtor)(void *));
extern fMTRemoveKeyDtor __mingw_gMTRemoveKeyDtor;
extern fMTKeyDtor __mingw_gMTKeyDtor;
extern int __mingw_usemthread_dll;
#endif
@ -36,8 +31,6 @@ __mingwthr_remove_key_dtor (DWORD key)
#endif
return ___w64_mingwthr_remove_key_dtor (key);
#ifndef _WIN64
if (__mingw_gMTRemoveKeyDtor)
return (*__mingw_gMTRemoveKeyDtor) (key);
return 0;
#endif
}
@ -51,10 +44,6 @@ __mingwthr_key_dtor (DWORD key, void (*dtor)(void *))
if (!__mingw_usemthread_dll)
#endif
return ___w64_mingwthr_add_key_dtor (key, dtor);
#ifndef _WIN64
if (__mingw_gMTKeyDtor)
return (*__mingw_gMTKeyDtor) (key, dtor);
#endif
}
return 0;
}

View file

@ -81,13 +81,7 @@ static __CRT_THREAD TlsDtorNode dtor_list_head;
extern int _CRT_MT;
#ifndef _WIN64
#define MINGWM10_DLL "mingwm10.dll"
typedef int (*fMTRemoveKeyDtor)(DWORD key);
typedef int (*fMTKeyDtor)(DWORD key, void (*dtor)(void *));
fMTRemoveKeyDtor __mingw_gMTRemoveKeyDtor;
fMTKeyDtor __mingw_gMTKeyDtor;
int __mingw_usemthread_dll;
static HANDLE __mingw_mthread_hdll;
#endif
BOOL WINAPI __dyn_tls_init (HANDLE, DWORD, LPVOID);
@ -98,30 +92,6 @@ __dyn_tls_init (HANDLE hDllHandle, DWORD dwReason, LPVOID lpreserved)
_PVFV *pfunc;
uintptr_t ps;
#ifndef _WIN64
if (_winmajor < 4)
{
__mingw_usemthread_dll = 1;
__mingw_mthread_hdll = LoadLibrary (MINGWM10_DLL);
if (__mingw_mthread_hdll != NULL)
{
__mingw_gMTRemoveKeyDtor = (fMTRemoveKeyDtor) GetProcAddress (__mingw_mthread_hdll, "__mingwthr_remove_key_dtor");
__mingw_gMTKeyDtor = (fMTKeyDtor) GetProcAddress (__mingw_mthread_hdll, "__mingwthr_key_dtor");
}
if (__mingw_mthread_hdll == NULL || !__mingw_gMTRemoveKeyDtor || !__mingw_gMTKeyDtor)
{
__mingw_gMTKeyDtor = NULL;
__mingw_gMTRemoveKeyDtor = NULL;
if (__mingw_mthread_hdll)
FreeLibrary (__mingw_mthread_hdll);
__mingw_mthread_hdll = NULL;
_CRT_MT = 0;
return TRUE;
}
_CRT_MT = 1;
return TRUE;
}
#endif
/* We don't let us trick here. */
if (_CRT_MT != 2)
_CRT_MT = 2;