From e739d6d0d195eee2d648e4f51c0f7c9b42fb02b5 Mon Sep 17 00:00:00 2001 From: Attila Sukosd Date: Wed, 26 Aug 2015 15:55:21 +0200 Subject: [PATCH] move HMODULE m declaration to top Needed for the function to be C89 compatible, so it compiles with Visual Studio 2013. --- src/win_delay_load_hook.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/win_delay_load_hook.c b/src/win_delay_load_hook.c index 05c4c39..f397cfa 100644 --- a/src/win_delay_load_hook.c +++ b/src/win_delay_load_hook.c @@ -16,6 +16,7 @@ #include static FARPROC WINAPI load_exe_hook(unsigned int event, DelayLoadInfo* info) { + HMODULE m; if (event != dliNotePreLoadLibrary) return NULL; @@ -23,7 +24,7 @@ static FARPROC WINAPI load_exe_hook(unsigned int event, DelayLoadInfo* info) { _stricmp(info->szDll, "node.exe") != 0) return NULL; - HMODULE m = GetModuleHandle(NULL); + m = GetModuleHandle(NULL); return (FARPROC) m; }