diff --git a/src/cmdline/ConvertCommand.cpp b/src/cmdline/ConvertCommand.cpp index 4fa6e7465d..aad75516e1 100644 --- a/src/cmdline/ConvertCommand.cpp +++ b/src/cmdline/ConvertCommand.cpp @@ -130,7 +130,7 @@ exitcode_t CommandLine::HandleCommandConvert(CommandLineArgEnumerator * enumerat } catch (Exception ex) { - Console::Error::WriteLine(ex.GetMsg()); + Console::Error::WriteLine(ex.GetMessage()); return EXITCODE_FAIL; } } diff --git a/src/core/Diagnostics.cpp b/src/core/Diagnostics.cpp index b9d7cfe312..dedbee4745 100644 --- a/src/core/Diagnostics.cpp +++ b/src/core/Diagnostics.cpp @@ -19,6 +19,7 @@ #if defined(DEBUG) && defined(__WINDOWS__) #define WIN32_LEAN_AND_MEAN #include + #undef GetMessage #endif #include "Diagnostics.hpp" diff --git a/src/core/Exception.hpp b/src/core/Exception.hpp index 23c80ae4b4..4e966c6e02 100644 --- a/src/core/Exception.hpp +++ b/src/core/Exception.hpp @@ -37,7 +37,6 @@ public: const char * what() const throw() override { return _message.c_str(); } const char * GetMessage() const { return _message.c_str(); } - const char * GetMsg() const { return _message.c_str(); } private: std::string _message; diff --git a/src/core/Guard.cpp b/src/core/Guard.cpp index b002d0be53..710a4d90e8 100644 --- a/src/core/Guard.cpp +++ b/src/core/Guard.cpp @@ -21,6 +21,7 @@ #ifdef __WINDOWS__ #define WIN32_LEAN_AND_MEAN #include +#undef GetMessage #endif #include "Console.hpp" diff --git a/src/network/NetworkUser.cpp b/src/network/NetworkUser.cpp index c1e77b0940..7f07eea019 100644 --- a/src/network/NetworkUser.cpp +++ b/src/network/NetworkUser.cpp @@ -112,7 +112,7 @@ void NetworkUserManager::Load() } catch (Exception ex) { - Console::Error::WriteLine("Failed to read %s as JSON. %s", path, ex.GetMsg()); + Console::Error::WriteLine("Failed to read %s as JSON. %s", path, ex.GetMessage()); } } } diff --git a/src/network/TcpSocket.cpp b/src/network/TcpSocket.cpp index 0dec7b1a46..4d470ac262 100644 --- a/src/network/TcpSocket.cpp +++ b/src/network/TcpSocket.cpp @@ -28,6 +28,7 @@ #include #include + #undef GetMessage #define LAST_SOCKET_ERROR() WSAGetLastError() #undef EWOULDBLOCK #define EWOULDBLOCK WSAEWOULDBLOCK @@ -321,7 +322,7 @@ public: } catch (Exception ex) { - req->Socket->_error = std::string(ex.GetMsg()); + req->Socket->_error = std::string(ex.GetMessage()); } SDL_UnlockMutex(req->Socket->_connectMutex); diff --git a/src/network/network.cpp b/src/network/network.cpp index d1e7d08a6a..b571f993b9 100644 --- a/src/network/network.cpp +++ b/src/network/network.cpp @@ -291,7 +291,7 @@ bool Network::BeginServer(unsigned short port, const char* address) } catch (Exception ex) { - Console::Error::WriteLine(ex.GetMsg()); + Console::Error::WriteLine(ex.GetMessage()); Close(); return false; } @@ -754,7 +754,7 @@ void Network::LoadGroups() try { json = Json::ReadFromFile(path); } catch (const Exception& e) { - log_error("Failed to read %s as JSON. Setting default groups. %s", path, e.GetMsg()); + log_error("Failed to read %s as JSON. Setting default groups. %s", path, e.GetMessage()); // Hardcoded permission groups SetupDefaultGroups(); return; diff --git a/src/platform/platform.h b/src/platform/platform.h index 88ad8d3bf9..39d5edc2aa 100644 --- a/src/platform/platform.h +++ b/src/platform/platform.h @@ -194,6 +194,7 @@ datetime64 platform_get_datetime_now_utc(); #define WIN32_LEAN_AND_MEAN #endif #include + #undef GetMessage int windows_get_registry_install_info(rct2_install_info *installInfo, char *source, char *font, uint8 charset); HWND windows_get_window_handle();