Re-add JSONCPP_NORETURN (#1041)

Fixes Visual Studio 2013 compatibility.
This commit is contained in:
es1x
2019-10-11 21:33:36 +03:00
committed by Jordan Bayles
parent f34bf24bbd
commit 2ee3b1dbb1
2 changed files with 18 additions and 6 deletions

View File

@@ -207,13 +207,13 @@ Exception::~Exception() JSONCPP_NOEXCEPT {}
char const* Exception::what() const JSONCPP_NOEXCEPT { return msg_.c_str(); }
RuntimeError::RuntimeError(String const& msg) : Exception(msg) {}
LogicError::LogicError(String const& msg) : Exception(msg) {}
[[noreturn]] void throwRuntimeError(String const& msg) {
JSONCPP_NORETURN void throwRuntimeError(String const& msg) {
throw RuntimeError(msg);
}
[[noreturn]] void throwLogicError(String const& msg) { throw LogicError(msg); }
JSONCPP_NORETURN void throwLogicError(String const& msg) { throw LogicError(msg); }
#else // !JSON_USE_EXCEPTION
[[noreturn]] void throwRuntimeError(String const& msg) { abort(); }
[[noreturn]] void throwLogicError(String const& msg) { abort(); }
JSONCPP_NORETURN void throwRuntimeError(String const& msg) { abort(); }
JSONCPP_NORETURN void throwLogicError(String const& msg) { abort(); }
#endif
// //////////////////////////////////////////////////////////////////