aboutsummaryrefslogtreecommitdiff
path: root/src/common/assert.cpp
blob: e2c2cade3ffb945defa703a55839142ceb41b3d7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// 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/logging/backend.h"

#include "common/settings.h"

void assert_fail_impl() {
    if (Settings::values.use_debug_asserts) {
        Common::Log::Stop();
        Crash();
    }
}

[[noreturn]] void unreachable_impl() {
    Common::Log::Stop();
    Crash();
    throw std::runtime_error("Unreachable code");
}