diff options
author | Max Kellermann <max@duempel.org> | 2014-12-05 00:05:00 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-12-05 00:10:44 +0100 |
commit | ad4e597f74040fa5279ce817bbfe4d6fff342b83 (patch) | |
tree | becdf02833498055974209a5a247022c4c4ad8bd /src | |
parent | ee3610a2d26dff8d6c50fd5a3f14a8dc0ca2d534 (diff) | |
download | mpd-ad4e597f74040fa5279ce817bbfe4d6fff342b83.tar.gz mpd-ad4e597f74040fa5279ce817bbfe4d6fff342b83.tar.xz mpd-ad4e597f74040fa5279ce817bbfe4d6fff342b83.zip |
util/Error: use FormatMessage() instead of g_win32_error_message()
Diffstat (limited to 'src')
-rw-r--r-- | src/util/Error.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/util/Error.cxx b/src/util/Error.cxx index 92b2cc5d0..67a1b03fd 100644 --- a/src/util/Error.cxx +++ b/src/util/Error.cxx @@ -32,7 +32,7 @@ #include "Domain.hxx" #ifdef WIN32 -#include <glib.h> +#include <windows.h> #endif #include <errno.h> @@ -135,7 +135,11 @@ Error::FormatErrno(const char *fmt, ...) void Error::SetLastError(DWORD _code, const char *prefix) { - const char *msg = g_win32_error_message(_code); + char msg[256]; + FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + nullptr, _code, 0, msg, sizeof(msg), nullptr); + Format(win32_domain, int(_code), "%s: %s", prefix, msg); } |