Work around windows.h clobbering GetMessage.

windows.h uses a macro to forward GetMessage to GetMessageA or
GetMessageW, so to work around that we do the same on windows.
This commit is contained in:
Robert Maynard 2014-05-19 14:23:30 -04:00
parent 1ef967a426
commit 552a8ab160

@ -36,6 +36,14 @@ class Error
public:
const std::string &GetMessage() const { return this->Message; }
//GetMessage is a macro defined by <windows.h> to redirrect to
//GetMessageA or W depending on if you are using ansi or unicode.
//To get around this we make our own A/W variants on windows.
#ifdef _WIN32
const std::string &GetMessageA() const { return this->Message; }
const std::string &GetMessageW() const { return this->Message; }
#endif
protected:
Error() { }
Error(const std::string message) : Message(message) { }