Add RTTI disabled logic
This commit is contained in:
parent
5fc084d808
commit
a18eef8d31
@ -506,11 +506,18 @@ class other_error : public exception
|
|||||||
template<class Exception>
|
template<class Exception>
|
||||||
void try_throw_exception(exception* ex)
|
void try_throw_exception(exception* ex)
|
||||||
{
|
{
|
||||||
|
#ifdef JSON_EXCEPTIONS_ENABLED
|
||||||
|
// Only use RTTI if necessary (exceptions are enabled). This way
|
||||||
|
// can be compiled with no RTTI.
|
||||||
Exception* down = dynamic_cast<Exception*>(ex);
|
Exception* down = dynamic_cast<Exception*>(ex);
|
||||||
if(down != nullptr)
|
if(down != nullptr)
|
||||||
{
|
{
|
||||||
JSON_THROW(*down);
|
JSON_THROW(*down);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
ex = ex; // suppress unreferenced formal parameter warnings
|
||||||
|
std::abort();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user