diff options
author | Shauren <shauren.trinity@gmail.com> | 2020-08-07 16:35:42 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2020-08-07 17:19:18 +0200 |
commit | 39c5e03b749d44df346b8f37aed3eb898526365a (patch) | |
tree | 7438c00e12183e28c461f981dcda426db682697a /src | |
parent | 83ed35fe62c16f5697f253a9a44bba7dcb83e80d (diff) |
Core/CrashHandler: #ifdef cleanup to make VS not choke when parsing, fixed file being all red in editor
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/common/Debugging/WheatyExceptionReport.cpp | 26 | ||||
-rw-r--r-- | src/common/Debugging/WheatyExceptionReport.h | 7 | ||||
-rw-r--r-- | src/server/authserver/CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/server/worldserver/CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/tools/map_extractor/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/tools/mmaps_generator/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/tools/vmap4_assembler/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/tools/vmap4_extractor/CMakeLists.txt | 4 |
9 files changed, 18 insertions, 41 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 22d6fd1218c..0949c245635 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -8,12 +8,12 @@ # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -if(WIN32) +if(WIN32 AND MSVC) set(sources_windows ${CMAKE_SOURCE_DIR}/src/common/Debugging/WheatyExceptionReport.cpp ${CMAKE_SOURCE_DIR}/src/common/Debugging/WheatyExceptionReport.h ) -endif(WIN32) +endif() add_subdirectory(genrev) add_subdirectory(common) diff --git a/src/common/Debugging/WheatyExceptionReport.cpp b/src/common/Debugging/WheatyExceptionReport.cpp index c95d5fd4d3b..74ea5b003d4 100644 --- a/src/common/Debugging/WheatyExceptionReport.cpp +++ b/src/common/Debugging/WheatyExceptionReport.cpp @@ -3,30 +3,16 @@ // MSDN Magazine, 2002 // FILE: WheatyExceptionReport.CPP //========================================== -#include "CompilerDefs.h" - -#if TRINITY_PLATFORM == TRINITY_PLATFORM_WINDOWS && !defined(__MINGW32__) -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#pragma warning(disable:4996) -#pragma warning(disable:4312) -#pragma warning(disable:4311) -#include <windows.h> -#include <tlhelp32.h> -#include <cstdio> -#include <tchar.h> -#define _NO_CVCONST_H -#include <dbghelp.h> - #include "WheatyExceptionReport.h" - #include "Common.h" #include "Errors.h" #include "GitRevision.h" #include <algorithm> #include <ehdata.h> #include <rttidata.h> +#include <cstdio> +#include <tlhelp32.h> +#include <tchar.h> #define CrashFolder _T("Crashes") #pragma comment(linker, "/DEFAULTLIB:dbghelp.lib") @@ -434,14 +420,14 @@ void WheatyExceptionReport::PrintSystemInfo() ::GlobalMemoryStatus(&MemoryStatus); TCHAR sString[1024]; Log(_T("//=====================================================\r\n")); - if (_GetProcessorName(sString, countof(sString))) + if (_GetProcessorName(sString, std::size(sString))) Log(_T("*** Hardware ***\r\nProcessor: %s\r\nNumber Of Processors: %d\r\nPhysical Memory: %d KB (Available: %d KB)\r\nCommit Charge Limit: %d KB\r\n"), sString, SystemInfo.dwNumberOfProcessors, MemoryStatus.dwTotalPhys/0x400, MemoryStatus.dwAvailPhys/0x400, MemoryStatus.dwTotalPageFile/0x400); else Log(_T("*** Hardware ***\r\nProcessor: <unknown>\r\nNumber Of Processors: %d\r\nPhysical Memory: %d KB (Available: %d KB)\r\nCommit Charge Limit: %d KB\r\n"), SystemInfo.dwNumberOfProcessors, MemoryStatus.dwTotalPhys/0x400, MemoryStatus.dwAvailPhys/0x400, MemoryStatus.dwTotalPageFile/0x400); - if (_GetWindowsVersion(sString, countof(sString))) + if (_GetWindowsVersion(sString, std::size(sString))) Log(_T("\r\n*** Operation System ***\r\n%s\r\n"), sString); else Log(_T("\r\n*** Operation System:\r\n<unknown>\r\n")); @@ -1585,5 +1571,3 @@ std::string SymbolDetail::ToString() } return formatted; } - -#endif // _WIN32 diff --git a/src/common/Debugging/WheatyExceptionReport.h b/src/common/Debugging/WheatyExceptionReport.h index a3cb4b2f04c..912a98c198a 100644 --- a/src/common/Debugging/WheatyExceptionReport.h +++ b/src/common/Debugging/WheatyExceptionReport.h @@ -1,16 +1,16 @@ #ifndef _WHEATYEXCEPTIONREPORT_ #define _WHEATYEXCEPTIONREPORT_ -#if TRINITY_PLATFORM == TRINITY_PLATFORM_WINDOWS && !defined(__MINGW32__) +#define _NO_CVCONST_H +#include <windows.h> #include <winnt.h> #include <winternl.h> #include <dbghelp.h> #include <set> -#include <stdlib.h> +#include <cstdlib> #include <stack> #include <mutex> -#define countof _countof #define WER_MAX_ARRAY_ELEMENTS_COUNT 10 #define WER_MAX_NESTING_LEVEL 4 @@ -200,5 +200,4 @@ class WheatyExceptionReport }; extern WheatyExceptionReport g_WheatyExceptionReport; // global instance of class -#endif // _WIN32 #endif // _WHEATYEXCEPTIONREPORT_ diff --git a/src/server/authserver/CMakeLists.txt b/src/server/authserver/CMakeLists.txt index 99fa09d2eee..78995e39bd6 100644 --- a/src/server/authserver/CMakeLists.txt +++ b/src/server/authserver/CMakeLists.txt @@ -16,8 +16,9 @@ CollectSourceFiles( # Exclude ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders) +list(APPEND PRIVATE_SOURCES ${sources_windows}) + if(WIN32) - list(APPEND PRIVATE_SOURCES ${sources_windows}) if(MSVC) list(APPEND PRIVATE_SOURCES authserver.rc) endif() diff --git a/src/server/worldserver/CMakeLists.txt b/src/server/worldserver/CMakeLists.txt index a47cf79286d..f67a7a5b7fe 100644 --- a/src/server/worldserver/CMakeLists.txt +++ b/src/server/worldserver/CMakeLists.txt @@ -14,8 +14,9 @@ CollectSourceFiles( # Exclude ${CMAKE_CURRENT_SOURCE_DIR}/PrecompiledHeaders) +list(APPEND PRIVATE_SOURCES ${sources_windows}) + if(WIN32) - list(APPEND PRIVATE_SOURCES ${sources_windows}) if(MSVC) list(APPEND PRIVATE_SOURCES worldserver.rc) endif() diff --git a/src/tools/map_extractor/CMakeLists.txt b/src/tools/map_extractor/CMakeLists.txt index 20c3e43a9b1..e80c9d9a939 100644 --- a/src/tools/map_extractor/CMakeLists.txt +++ b/src/tools/map_extractor/CMakeLists.txt @@ -12,9 +12,7 @@ CollectSourceFiles( ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE_SOURCES) -if(WIN32) - list(APPEND PRIVATE_SOURCES ${sources_windows}) -endif() +list(APPEND PRIVATE_SOURCES ${sources_windows}) add_executable(mapextractor ${PRIVATE_SOURCES} diff --git a/src/tools/mmaps_generator/CMakeLists.txt b/src/tools/mmaps_generator/CMakeLists.txt index 13497a8830f..73d13b4c665 100644 --- a/src/tools/mmaps_generator/CMakeLists.txt +++ b/src/tools/mmaps_generator/CMakeLists.txt @@ -12,9 +12,7 @@ CollectSourceFiles( ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE_SOURCES) -if(WIN32) - list(APPEND PRIVATE_SOURCES ${sources_windows}) -endif() +list(APPEND PRIVATE_SOURCES ${sources_windows}) add_executable(mmaps_generator ${PRIVATE_SOURCES}) diff --git a/src/tools/vmap4_assembler/CMakeLists.txt b/src/tools/vmap4_assembler/CMakeLists.txt index dd434256f4a..527cedfdc92 100644 --- a/src/tools/vmap4_assembler/CMakeLists.txt +++ b/src/tools/vmap4_assembler/CMakeLists.txt @@ -10,9 +10,7 @@ set(PRIVATE_SOURCES VMapAssembler.cpp) -if(WIN32) - list(APPEND PRIVATE_SOURCES ${sources_windows}) -endif() +list(APPEND PRIVATE_SOURCES ${sources_windows}) add_executable(vmap4assembler ${PRIVATE_SOURCES}) diff --git a/src/tools/vmap4_extractor/CMakeLists.txt b/src/tools/vmap4_extractor/CMakeLists.txt index b5bcdac8f9d..3bde87bff52 100644 --- a/src/tools/vmap4_extractor/CMakeLists.txt +++ b/src/tools/vmap4_extractor/CMakeLists.txt @@ -12,9 +12,7 @@ CollectSourceFiles( ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE_SOURCES) -if(WIN32) - list(APPEND PRIVATE_SOURCES ${sources_windows}) -endif() +list(APPEND PRIVATE_SOURCES ${sources_windows}) add_executable(vmap4extractor ${PRIVATE_SOURCES}) |