From a838a03412b7d77cc953c2ec617aa09510f91de8 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 5 Dec 2014 00:14:28 +0100 Subject: system/FatalError: use FormatMessage() instead of g_win32_error_message() --- src/system/FatalError.cxx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/system/FatalError.cxx b/src/system/FatalError.cxx index 35e94f169..a2d06bcb1 100644 --- a/src/system/FatalError.cxx +++ b/src/system/FatalError.cxx @@ -23,10 +23,6 @@ #include "util/Domain.hxx" #include "LogV.hxx" -#ifdef HAVE_GLIB -#include -#endif - #include #include #include @@ -83,7 +79,12 @@ FatalSystemError(const char *msg) { const char *system_error; #ifdef WIN32 - system_error = g_win32_error_message(GetLastError()); + char buffer[256]; + FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + nullptr, GetLastError(), 0, + buffer, sizeof(buffer), nullptr); + system_error = buffer; #else system_error = strerror(errno); #endif -- cgit v1.2.3