1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-11 13:10:58 +00:00

Added a crash handler to dump the backtrace on Windows, Linux and OS X

This commit is contained in:
Marcelo Fernandez
2017-08-03 21:07:16 -03:00
parent 8be9e8b484
commit 60cf34b968
23 changed files with 782 additions and 13 deletions

View File

@@ -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) {