From 8a7fe32a2c3a214739fc8f631e96c56b883d673a Mon Sep 17 00:00:00 2001 From: lizzie Date: Mon, 3 Nov 2025 21:07:30 +0100 Subject: [common] Do not expose platform specific Crash() macro that is only used ever once (#2909) thing is only ever used once and its also platform specific... uh Signed-off-by: lizzie Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2909 Reviewed-by: crueter Reviewed-by: Shinmegumi Reviewed-by: MaranBr Reviewed-by: Caio Oliveira Co-authored-by: lizzie Co-committed-by: lizzie --- src/common/assert.cpp | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) (limited to 'src/common/assert.cpp') 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(); } -- cgit v1.2.3