mirror of
https://github.com/pound-emu/pound.git
synced 2025-12-13 13:37:02 +00:00
Major project restructuring
Remove unecessary files and made the tree much more cleaner. Signed-off-by: Ronald Caesar <github43132@proton.me>
This commit is contained in:
parent
13b2e741b9
commit
05c4f7025f
62 changed files with 2698 additions and 2453 deletions
59
core/common/Assert.cpp
Normal file
59
core/common/Assert.cpp
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
// Copyright 2025 Xenon Emulator Project. All rights reserved.
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "Arch.h"
|
||||
#include "Assert.h"
|
||||
#include "Logging/Backend.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define Crash() __debugbreak()
|
||||
#else
|
||||
#if defined(ARCH_X86_64)
|
||||
#define Crash() __asm__ __volatile__("int $3")
|
||||
#elif defined(ARCH_X86)
|
||||
#define Crash() __asm__ __volatile__("int $3")
|
||||
#elif defined(ARCH_AARCH64)
|
||||
#define Crash() __asm__ __volatile__("brk 0")
|
||||
#elif defined(ARCH_PPC)
|
||||
#include <signal.h>
|
||||
#ifdef SIGTRAP
|
||||
#define Crash() raise(SIGTRAP)
|
||||
#else
|
||||
#define Crash() raise(SIGABRT)
|
||||
#endif
|
||||
#else
|
||||
#define Crash() __builtin_trap()
|
||||
#endif
|
||||
#endif // _MSVC_VER
|
||||
|
||||
void throw_fail_impl()
|
||||
{
|
||||
::fflush(stdout);
|
||||
Crash();
|
||||
}
|
||||
|
||||
void assert_fail_impl()
|
||||
{
|
||||
printf("Assertion Failed!\n");
|
||||
throw_fail_impl();
|
||||
}
|
||||
|
||||
[[noreturn]] void unreachable_impl()
|
||||
{
|
||||
::fflush(stdout);
|
||||
Crash();
|
||||
throw std::runtime_error("Unreachable code");
|
||||
}
|
||||
|
||||
void assert_fail_debug_msg(const std::string& msg)
|
||||
{
|
||||
printf("Assertion Failed! %s\n", msg.c_str());
|
||||
assert_fail_impl();
|
||||
}
|
||||
|
||||
void throw_fail_debug_msg(const std::string& msg)
|
||||
{
|
||||
printf("Assertion Failed! %s\n", msg.c_str());
|
||||
throw_fail_impl();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue