From fd0a7ba871060c895fdf701799dbf649ee697078 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 15 Sep 2024 12:13:54 +0200 Subject: Core/CrashHandler: Compile WheatyExceptionReport only once and moved its global variable initializer to all projects using it --- src/tools/map_extractor/System.cpp | 6 ++++++ src/tools/mmaps_generator/PathGenerator.cpp | 6 ++++++ src/tools/vmap4_assembler/VMapAssembler.cpp | 6 ++++++ src/tools/vmap4_extractor/vmapexport.cpp | 6 ++++++ 4 files changed, 24 insertions(+) (limited to 'src/tools') diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp index ca91068a234..698adff25c1 100644 --- a/src/tools/map_extractor/System.cpp +++ b/src/tools/map_extractor/System.cpp @@ -1567,3 +1567,9 @@ int main(int argc, char * arg[]) return 0; } + +#if TRINITY_PLATFORM == TRINITY_PLATFORM_WINDOWS +#include "WheatyExceptionReport.h" +// must be at end of file because of init_seg pragma +INIT_CRASH_HANDLER(); +#endif diff --git a/src/tools/mmaps_generator/PathGenerator.cpp b/src/tools/mmaps_generator/PathGenerator.cpp index 4b9620bff1f..f3ba4ab48b6 100644 --- a/src/tools/mmaps_generator/PathGenerator.cpp +++ b/src/tools/mmaps_generator/PathGenerator.cpp @@ -458,3 +458,9 @@ int main(int argc, char** argv) printf("Finished. MMAPS were built in %s\n", secsToTimeString(GetMSTimeDiffToNow(start) / 1000).c_str()); return 0; } + +#if TRINITY_PLATFORM == TRINITY_PLATFORM_WINDOWS +#include "WheatyExceptionReport.h" +// must be at end of file because of init_seg pragma +INIT_CRASH_HANDLER(); +#endif diff --git a/src/tools/vmap4_assembler/VMapAssembler.cpp b/src/tools/vmap4_assembler/VMapAssembler.cpp index 444f748753c..5cdc214665e 100644 --- a/src/tools/vmap4_assembler/VMapAssembler.cpp +++ b/src/tools/vmap4_assembler/VMapAssembler.cpp @@ -111,3 +111,9 @@ Optional HandleArgs(int argc, char* argv[], std::string* src, std::string* return {}; } + +#if TRINITY_PLATFORM == TRINITY_PLATFORM_WINDOWS +#include "WheatyExceptionReport.h" +// must be at end of file because of init_seg pragma +INIT_CRASH_HANDLER(); +#endif diff --git a/src/tools/vmap4_extractor/vmapexport.cpp b/src/tools/vmap4_extractor/vmapexport.cpp index 9ab9ccfac19..cc518cfab50 100644 --- a/src/tools/vmap4_extractor/vmapexport.cpp +++ b/src/tools/vmap4_extractor/vmapexport.cpp @@ -604,3 +604,9 @@ int main(int argc, char ** argv) printf("Extract %s. Work complete. No errors.\n", VMAP::VMAP_MAGIC); return 0; } + +#if TRINITY_PLATFORM == TRINITY_PLATFORM_WINDOWS +#include "WheatyExceptionReport.h" +// must be at end of file because of init_seg pragma +INIT_CRASH_HANDLER(); +#endif -- cgit v1.2.3