2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00
yuzu/src/common/assert.cpp

23 lines
525 B
C++
Raw Normal View History

// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "common/assert.h"
#include "common/common_funcs.h"
#include "common/settings.h"
void assert_check_condition(bool cond, std::function<void()>&& on_failure) {
2022-06-08 00:46:10 +01:00
if (!cond) [[unlikely]] {
on_failure();
if (Settings::values.use_debug_asserts) {
Crash();
}
}
}
[[noreturn]] void unreachable_impl() {
Crash();
throw std::runtime_error("Unreachable code");
}