diff --git a/source/lib/sysdep/win/wsdl.cpp b/source/lib/sysdep/win/wsdl.cpp index bd6ba13cf1..20706de763 100755 --- a/source/lib/sysdep/win/wsdl.cpp +++ b/source/lib/sysdep/win/wsdl.cpp @@ -461,6 +461,8 @@ void enable_kbd_hook(bool enable) static int wsdl_init() { + hInst = GetModuleHandle(0); + // ignore BoundsChecker warnings here. subsystem is set to "Windows" // to avoid the OS opening a console on startup (ugly). that means // stdout isn't associated with a lowio handle; _close ends up @@ -469,6 +471,7 @@ static int wsdl_init() if(!ret) debug_warn("stdout freopen failed"); setvbuf(stdout, 0, _IONBF, 0); + return 0; } @@ -571,8 +574,6 @@ int SDL_SetVideoMode(int w, int h, int bpp, unsigned long flags) * pixel format isn't supposed to be changed more than once */ - hInst = GetModuleHandle(0); - /* register window class */ static WNDCLASS wc; wc.style = CS_OWNDC;