mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 20:59:19 +02:00
Move crash handling logic for windows only blocks
This commit is contained in:
6
EU07.cpp
6
EU07.cpp
@@ -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,8 +80,10 @@ 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();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user