common: Don't test ASSERT conditions inline
This commit is contained in:
parent
084d7d6b01
commit
58fea44eb5
2 changed files with 36 additions and 32 deletions
|
@ -6,9 +6,13 @@
|
|||
|
||||
#include "common/settings.h"
|
||||
|
||||
void assert_handle_failure() {
|
||||
if (Settings::values.use_debug_asserts) {
|
||||
Crash();
|
||||
void assert_check_condition(bool cond, std::function<void()>&& on_failure) {
|
||||
if (!cond) {
|
||||
on_failure();
|
||||
|
||||
if (Settings::values.use_debug_asserts) {
|
||||
Crash();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue