Skip to content

Commit

Permalink
src,win: improve unmanaged handling
Browse files Browse the repository at this point in the history
Used scoped disabling of managed code handling to ensure no other
files get affected.

PR-URL: #1852
Reviewed-By: João Reis <reis@janeasystems.com>
  • Loading branch information
peter-sabath authored and rvagg committed Sep 26, 2019
1 parent 5553cd9 commit 1cb4708
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/win_delay_load_hook.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit 1cb4708

Please sign in to comment.