diff --git a/src/win_delay_load_hook.cc b/src/win_delay_load_hook.cc index 567c4cc8d7..169f8029f1 100644 --- a/src/win_delay_load_hook.cc +++ b/src/win_delay_load_hook.cc @@ -7,10 +7,10 @@ * This allows compiled addons to work when the host executable is renamed. */ -#pragma unmanaged - #ifdef _MSC_VER +#pragma managed(push, off) + #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif @@ -34,4 +34,6 @@ static FARPROC WINAPI load_exe_hook(unsigned int event, DelayLoadInfo* info) { decltype(__pfnDliNotifyHook2) __pfnDliNotifyHook2 = load_exe_hook; +#pragma managed(pop) + #endif