summaryrefslogtreecommitdiff
path: root/src/system/FatalError.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-12-05 00:14:28 +0100
committerMax Kellermann <max@duempel.org>2014-12-05 00:15:30 +0100
commita838a03412b7d77cc953c2ec617aa09510f91de8 (patch)
tree45931ee0ed3c061e5fe2a01dc478c3fb3335b51c /src/system/FatalError.cxx
parentad4e597f74040fa5279ce817bbfe4d6fff342b83 (diff)
system/FatalError: use FormatMessage() instead of g_win32_error_message()
Diffstat (limited to 'src/system/FatalError.cxx')
-rw-r--r--src/system/FatalError.cxx11
1 files changed, 6 insertions, 5 deletions
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 <glib.h>
-#endif
-
#include <unistd.h>
#include <stdarg.h>
#include <stdio.h>
@@ -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