Allowed asserts to throw exceptions instead of calling std::exit

Former-commit-id: 892db922761a0a8122c60274b344c3e62de0a65f
This commit is contained in:
Lynix 2014-06-27 21:16:36 +02:00
parent 032b2ed79b
commit 76bfd0857e
1 changed files with 3 additions and 3 deletions

View File

@ -44,13 +44,13 @@ void NzError::Error(nzErrorType type, const NzString& error, unsigned int line,
s_lastErrorFunction = function; s_lastErrorFunction = function;
s_lastErrorLine = line; s_lastErrorLine = line;
if (type != nzErrorType_Warning && (s_flags & nzErrorFlag_ThrowException) != 0 && (s_flags & nzErrorFlag_ThrowExceptionDisabled) == 0)
throw std::runtime_error(error);
#if NAZARA_CORE_EXIT_ON_ASSERT_FAILURE #if NAZARA_CORE_EXIT_ON_ASSERT_FAILURE
if (type == nzErrorType_AssertFailed) if (type == nzErrorType_AssertFailed)
std::exit(EXIT_FAILURE); std::exit(EXIT_FAILURE);
#endif #endif
if (type != nzErrorType_Warning && (s_flags & nzErrorFlag_ThrowException) != 0 && (s_flags & nzErrorFlag_ThrowExceptionDisabled) == 0)
throw std::runtime_error(error);
} }
nzUInt32 NzError::GetFlags() nzUInt32 NzError::GetFlags()