summaryrefslogtreecommitdiff
path: root/platform/windows/godot_win.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'platform/windows/godot_win.cpp')
-rw-r--r--platform/windows/godot_win.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/platform/windows/godot_win.cpp b/platform/windows/godot_win.cpp
index d2ac6ecb50..cff2cbad42 100644
--- a/platform/windows/godot_win.cpp
+++ b/platform/windows/godot_win.cpp
@@ -156,10 +156,7 @@ int widechar_main(int argc, wchar_t **argv) {
return os.get_exit_code();
};
-int main(int _argc, char **_argv) {
- // _argc and _argv are ignored
- // we are going to use the WideChar version of them instead
-
+int _main() {
LPWSTR *wc_argv;
int argc;
int result;
@@ -177,6 +174,21 @@ int main(int _argc, char **_argv) {
return result;
}
+int main(int _argc, char **_argv) {
+// _argc and _argv are ignored
+// we are going to use the WideChar version of them instead
+
+#ifdef CRASH_HANDLER_EXCEPTION
+ __try {
+ return _main();
+ } __except (CrashHandlerException(GetExceptionInformation())) {
+ return 1;
+ }
+#else
+ return _main();
+#endif
+}
+
HINSTANCE godot_hinstance = NULL;
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {