mirror of
https://github.com/jedisct1/libsodium.git
synced 2026-08-25 08:37:13 +09:00
Don't define DllMain in static builds
This commit is contained in:
@@ -215,14 +215,13 @@ sodium_set_misuse_handler(void (*handler)(void))
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_WIN32) && !defined(SODIUM_STATIC)
|
||||
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved) {
|
||||
switch (fdwReason) {
|
||||
case DLL_PROCESS_DETACH:
|
||||
if (_sodium_lock_initialized == 2) {
|
||||
DeleteCriticalSection(&_sodium_lock);
|
||||
}
|
||||
break;
|
||||
(void) hinstDLL;
|
||||
(void) lpReserved;
|
||||
|
||||
if (fdwReason == DLL_PROCESS_DETACH && _sodium_lock_initialized == 2) {
|
||||
DeleteCriticalSection(&_sodium_lock);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user