From efbee8627873fbcee454319573cdf94816b25824 Mon Sep 17 00:00:00 2001 From: rustyx Date: Tue, 2 Feb 2016 11:27:18 +0100 Subject: Prevent MSVC from optimizing away tls_callback (resolves #318) --- src/tsd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tsd.c b/src/tsd.c index b85b8b9..34c1573 100644 --- a/src/tsd.c +++ b/src/tsd.c @@ -148,13 +148,15 @@ _tls_callback(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) #ifdef _MSC_VER # ifdef _M_IX86 # pragma comment(linker, "/INCLUDE:__tls_used") +# pragma comment(linker, "/INCLUDE:_tls_callback") # else # pragma comment(linker, "/INCLUDE:_tls_used") +# pragma comment(linker, "/INCLUDE:tls_callback") # endif # pragma section(".CRT$XLY",long,read) #endif JEMALLOC_SECTION(".CRT$XLY") JEMALLOC_ATTR(used) -static BOOL (WINAPI *const tls_callback)(HINSTANCE hinstDLL, +BOOL (WINAPI *const tls_callback)(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) = _tls_callback; #endif -- cgit v0.12