assert.cpp 493 B

123456789101112131415161718192021
  1. // SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #include "common/assert.h"
  4. #include "common/common_funcs.h"
  5. #include "common/logging/backend.h"
  6. #include "common/settings.h"
  7. void assert_fail_impl() {
  8. if (Settings::values.use_debug_asserts) {
  9. Common::Log::Stop();
  10. Crash();
  11. }
  12. }
  13. [[noreturn]] void unreachable_impl() {
  14. Common::Log::Stop();
  15. Crash();
  16. throw std::runtime_error("Unreachable code");
  17. }