]> git.tdb.fi Git - libs/core.git/blobdiff - source/core/systemerror.cpp
Move most platform-specific code into overlay directories
[libs/core.git] / source / core / systemerror.cpp
index 1ccee74ed4a80139c77e1e013567465f4325906e..5424ef0ee647d564a624eb4e190553d7a808f88e 100644 (file)
@@ -1,10 +1,3 @@
-#ifdef WIN32
-#include <windows.h>
-#include <msp/strings/lexicalcast.h>
-#else
-#include <cerrno>
-#include <cstring>
-#endif
 #include <limits>
 #include "systemerror.h"
 
@@ -22,23 +15,4 @@ system_error::system_error(const string &w, const string &e):
        code_(numeric_limits<int>::min())
 { }
 
-string system_error::get_message(int c)
-{
-#ifdef WIN32
-       if(c==-1)
-               c = GetLastError();
-
-       char msg[1024];
-       if(FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, 0, c, 0, msg, sizeof(msg), 0))
-               return msg;
-       else
-               return lexical_cast<string>(c, Fmt().hex());
-#else
-       if(c==-1)
-               c = errno;
-
-       return strerror(c);
-#endif
-}
-
 } // namespace Msp