16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 18:39:18 +02:00

Move crash handling logic for windows only blocks

This commit is contained in:
2025-08-21 20:19:12 +02:00
parent 84940c0db1
commit f5c7092551

View File

@@ -22,9 +22,11 @@ Stele, firleju, szociu, hunter, ZiomalCl, OLI_EU and others
#include "Logs.h" #include "Logs.h"
#include <cstdlib> #include <cstdlib>
#ifdef WITHDUMPGEN #ifdef WITHDUMPGEN
#ifdef _WIN32
#include <Windows.h> #include <Windows.h>
#include <DbgHelp.h> #include <DbgHelp.h>
#endif #endif
#endif
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma comment(linker, "/subsystem:console /ENTRY:mainCRTStartup") #pragma comment(linker, "/subsystem:console /ENTRY:mainCRTStartup")
@@ -40,6 +42,8 @@ void export_e3d_standalone(std::string in, std::string out, int flags, bool dyna
#include <sstream> #include <sstream>
#include <iomanip> #include <iomanip>
#include <Globals.h> #include <Globals.h>
#ifdef _WIN32
#pragma comment(lib, "Dbghelp.lib") #pragma comment(lib, "Dbghelp.lib")
LONG WINAPI CrashHandler(EXCEPTION_POINTERS *ExceptionInfo) LONG WINAPI CrashHandler(EXCEPTION_POINTERS *ExceptionInfo)
@@ -76,7 +80,9 @@ LONG WINAPI CrashHandler(EXCEPTION_POINTERS *ExceptionInfo)
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
#ifdef WITHDUMPGEN #ifdef WITHDUMPGEN
#ifdef _WIN32
SetUnhandledExceptionFilter(CrashHandler); SetUnhandledExceptionFilter(CrashHandler);
#endif
#endif #endif
// init start timestamp // init start timestamp
Global.startTimestamp = std::chrono::steady_clock::now(); Global.startTimestamp = std::chrono::steady_clock::now();