X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fcore%2Fsystemerror.cpp;h=5424ef0ee647d564a624eb4e190553d7a808f88e;hp=6d1d876c1f3e00fb94886a1612454af7443bf01a;hb=292aed8e23ea543b089d5f2a73000de4640befe7;hpb=c7afef88380ebebc8c2b04e48664d73281ec8848 diff --git a/source/core/systemerror.cpp b/source/core/systemerror.cpp index 6d1d876..5424ef0 100644 --- a/source/core/systemerror.cpp +++ b/source/core/systemerror.cpp @@ -1,10 +1,4 @@ -#ifdef WIN32 -#include -#include -#else -#include -#include -#endif +#include #include "systemerror.h" using namespace std; @@ -16,23 +10,9 @@ system_error::system_error(const string &w, int c): code_(c) { } -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(c, Fmt().hex()); -#else - if(c==-1) - c = errno; - - return strerror(c); -#endif -} +system_error::system_error(const string &w, const string &e): + runtime_error(w+": "+e), + code_(numeric_limits::min()) +{ } } // namespace Msp