aboutsummaryrefslogtreecommitdiff
path: root/src/common/assert.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/assert.cpp')
-rw-r--r--src/common/assert.cpp28
1 files changed, 21 insertions, 7 deletions
diff --git a/src/common/assert.cpp b/src/common/assert.cpp
index e2c2cade3f..e6be671865 100644
--- a/src/common/assert.cpp
+++ b/src/common/assert.cpp
@@ -1,21 +1,35 @@
+// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
+// SPDX-License-Identifier: GPL-3.0-or-later
// 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() {
+#ifdef _MSC_VER
+extern "C" {
+__declspec(dllimport) void __stdcall DebugBreak(void);
+}
+#endif
+void AssertFailSoftImpl() {
if (Settings::values.use_debug_asserts) {
Common::Log::Stop();
- Crash();
+#ifndef _MSC_VER
+# if defined(ARCHITECTURE_x86_64)
+ __asm__ __volatile__("int $3");
+# elif defined(ARCHITECTURE_arm64)
+ __asm__ __volatile__("brk #0");
+# else
+ exit(1);
+# endif
+#else // POSIX ^^^ _MSC_VER vvv
+ DebugBreak();
+#endif
}
}
-
-[[noreturn]] void unreachable_impl() {
+void AssertFatalImpl() {
Common::Log::Stop();
- Crash();
- throw std::runtime_error("Unreachable code");
+ std::abort();
}