diff options
author | Liam <byteslice@airmail.cc> | 2022-06-08 00:05:32 +0200 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2022-06-14 02:09:00 +0200 |
commit | 58fea44eb5bfe268c1ddd2ea063744eb7bbe7e44 (patch) | |
tree | 52b3e426fa061171cab80a7b61ab6e52aa163966 /src/common/assert.cpp | |
parent | common: Change semantics of UNREACHABLE to unconditionally crash (diff) | |
download | yuzu-58fea44eb5bfe268c1ddd2ea063744eb7bbe7e44.tar yuzu-58fea44eb5bfe268c1ddd2ea063744eb7bbe7e44.tar.gz yuzu-58fea44eb5bfe268c1ddd2ea063744eb7bbe7e44.tar.bz2 yuzu-58fea44eb5bfe268c1ddd2ea063744eb7bbe7e44.tar.lz yuzu-58fea44eb5bfe268c1ddd2ea063744eb7bbe7e44.tar.xz yuzu-58fea44eb5bfe268c1ddd2ea063744eb7bbe7e44.tar.zst yuzu-58fea44eb5bfe268c1ddd2ea063744eb7bbe7e44.zip |
Diffstat (limited to '')
-rw-r--r-- | src/common/assert.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/common/assert.cpp b/src/common/assert.cpp index a27a025ae..b20c19123 100644 --- a/src/common/assert.cpp +++ b/src/common/assert.cpp @@ -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(); + } } } |