aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/sdl/win32/win32-main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'backends/platform/sdl/win32/win32-main.cpp')
-rw-r--r--backends/platform/sdl/win32/win32-main.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/backends/platform/sdl/win32/win32-main.cpp b/backends/platform/sdl/win32/win32-main.cpp
index e5b26c3ff0..c6339f0c8c 100644
--- a/backends/platform/sdl/win32/win32-main.cpp
+++ b/backends/platform/sdl/win32/win32-main.cpp
@@ -40,8 +40,15 @@
#include "base/main.h"
int __stdcall WinMain(HINSTANCE /*hInst*/, HINSTANCE /*hPrevInst*/, LPSTR /*lpCmdLine*/, int /*iShowCmd*/) {
+#if !SDL_VERSION_ATLEAST(2, 0, 0)
SDL_SetModuleHandle(GetModuleHandle(NULL));
+#endif
+// HACK: __argc, __argv are broken and return zero when using mingwrt 4.0+ on MinGW
+#if defined(__GNUC__) && defined(__MINGW32__) && !defined(__MINGW64__)
+ return main(_argc, _argv);
+#else
return main(__argc, __argv);
+#endif
}
int main(int argc, char *argv[]) {