diff options
author | rubidium42 <rubidium@openttd.org> | 2021-04-30 15:38:22 +0200 |
---|---|---|
committer | rubidium42 <rubidium42@users.noreply.github.com> | 2021-05-01 19:36:22 +0200 |
commit | 22720332eb9922e20148c7aae1127f7304f6f7d3 (patch) | |
tree | 0efbcfac24474a10f88f956c1f4721cdd7af97e0 /src/network/core/core.cpp | |
parent | 0eb17a70af86d11e49d9560088900c9d65cb07c1 (diff) | |
download | openttd-22720332eb9922e20148c7aae1127f7304f6f7d3.tar.xz |
Codechange: encapsulate network error handling
Diffstat (limited to 'src/network/core/core.cpp')
-rw-r--r-- | src/network/core/core.cpp | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/src/network/core/core.cpp b/src/network/core/core.cpp index 5c12cb224..563deae96 100644 --- a/src/network/core/core.cpp +++ b/src/network/core/core.cpp @@ -13,7 +13,6 @@ #include "../../debug.h" #include "os_abstraction.h" #include "packet.h" -#include "../../string_func.h" #include "../../safeguards.h" @@ -48,20 +47,3 @@ void NetworkCoreShutdown() WSACleanup(); #endif } - -#if defined(_WIN32) -/** - * Return the string representation of the given error from the OS's network functions. - * @param error The error number (from \c NetworkGetLastError()). - * @return The error message, potentially an empty string but never \c nullptr. - */ -const char *NetworkGetErrorString(int error) -{ - static char buffer[512]; - if (FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, error, - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), buffer, sizeof(buffer), NULL) == 0) { - seprintf(buffer, lastof(buffer), "Unknown error %d", error); - } - return buffer; -} -#endif /* defined(_WIN32) */ |