diff options
author | Max Kellermann <max@duempel.org> | 2013-09-04 23:36:30 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-09-04 23:36:30 +0200 |
commit | ee9e238179677ad0168ead6edfe17f798dbf47dc (patch) | |
tree | 032c0f1593bc64f6745cd81cc124d9fc272a5010 /src/system/SocketError.hxx | |
parent | 29030b54c98b0aee65fbc10ebf7ba36bed98c02c (diff) | |
download | mpd-ee9e238179677ad0168ead6edfe17f798dbf47dc.tar.gz mpd-ee9e238179677ad0168ead6edfe17f798dbf47dc.tar.xz mpd-ee9e238179677ad0168ead6edfe17f798dbf47dc.zip |
system/SocketError: un-inline constructor
Reduces header dependencies.
Diffstat (limited to '')
-rw-r--r-- | src/system/SocketError.hxx | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/system/SocketError.hxx b/src/system/SocketError.hxx index c42e267dd..2b8332715 100644 --- a/src/system/SocketError.hxx +++ b/src/system/SocketError.hxx @@ -23,8 +23,6 @@ #include "gcc.h" #include "util/Error.hxx" -#include <glib.h> - #ifdef WIN32 #include <winsock2.h> typedef DWORD socket_error_t; @@ -97,18 +95,9 @@ class SocketErrorMessage { public: #ifdef WIN32 - explicit SocketErrorMessage(socket_error_t code=GetSocketError()) { - DWORD nbytes = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS | - FORMAT_MESSAGE_MAX_WIDTH_MASK, - NULL, code, 0, - (LPSTR)msg, sizeof(msg), NULL); - if (nbytes == 0) - strcpy(msg, "Unknown error"); - } + explicit SocketErrorMessage(socket_error_t code=GetSocketError()); #else - explicit SocketErrorMessage(socket_error_t code=GetSocketError()) - :msg(g_strerror(code)) {} + explicit SocketErrorMessage(socket_error_t code=GetSocketError()); #endif operator const char *() const { |