Skip to content

Commit

Permalink
win: work around __pfnDliNotifyHook2 type change
Browse files Browse the repository at this point in the history
Visual Studio 2015 Update 3 defines __pfnDliNotifyHook2 as const.
The decltype specifier makes the declaration work across all supported
versions of VS. It also requires that the source be compiled as C++.

Fixes: #949

PR-URL: #952
Reviewed-By: bnoordhuis - Ben Noordhuis <[email protected]>
  • Loading branch information
orangemocha committed Jun 13, 2016
1 parent 3df8222 commit fc4a8cc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion addon.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
'conditions': [
[ 'OS=="win"', {
'sources': [
'<(node_gyp_dir)/src/win_delay_load_hook.c',
'<(node_gyp_dir)/src/win_delay_load_hook.cc',
],
'msvs_settings': {
'VCLinkerTool': {
Expand Down
2 changes: 1 addition & 1 deletion src/win_delay_load_hook.c → src/win_delay_load_hook.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ static FARPROC WINAPI load_exe_hook(unsigned int event, DelayLoadInfo* info) {
return (FARPROC) m;
}

PfnDliHook __pfnDliNotifyHook2 = load_exe_hook;
decltype(__pfnDliNotifyHook2) __pfnDliNotifyHook2 = load_exe_hook;

#endif

0 comments on commit fc4a8cc

Please sign in to comment.