Compile with -fno-exceptions

This commit is contained in:
John Keiser
2020-03-14 15:23:56 -07:00
parent 1a5d8f1957
commit 8e2c06cb0e
16 changed files with 298 additions and 158 deletions
+8
View File
@@ -2652,10 +2652,18 @@ 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) {}
JSONCPP_NORETURN void throwRuntimeError(String const& msg) {
#if __cpp_exceptions
throw RuntimeError(msg);
#else
abort();
#endif
}
JSONCPP_NORETURN void throwLogicError(String const& msg) {
#if __cpp_exceptions
throw LogicError(msg);
#else
abort();
#endif
}
// //////////////////////////////////////////////////////////////////