os_DebugBreak is [[noreturn]]

This commit is contained in:
Flyinghead 2023-01-24 19:24:26 +01:00
parent 5096d50d37
commit 5703ef26cf
7 changed files with 11 additions and 16 deletions

View File

@ -383,9 +383,10 @@ int main(int argc, char* argv[])
}
#if defined(__unix__)
void os_DebugBreak()
[[noreturn]] void os_DebugBreak()
{
raise(SIGTRAP);
std::abort();
}
#endif

View File

@ -127,7 +127,7 @@ double os_GetSeconds()
}
#if !defined(__unix__) && !defined(LIBRETRO)
void os_DebugBreak()
[[noreturn]] void os_DebugBreak()
{
__builtin_trap();
}

View File

@ -167,17 +167,15 @@ inline static void JITWriteProtect(bool enabled) {
#define VER_EMUNAME "Flycast"
#define VER_SHORTNAME VER_EMUNAME
void os_DebugBreak();
#define dbgbreak os_DebugBreak()
#ifndef _MSC_VER
#define stricmp strcasecmp
#endif
[[noreturn]] void os_DebugBreak();
void fatal_error(const char* text, ...);
#define verify(x) do { if ((x) == false){ fatal_error("Verify Failed : " #x "\n in %s -> %s : %d", (__FUNCTION__), (__FILE__), __LINE__); dbgbreak;}} while (false)
#define die(reason) do { fatal_error("Fatal error : %s\n in %s -> %s : %d", (reason), (__FUNCTION__), (__FILE__), __LINE__); dbgbreak;} while (false)
#define verify(x) do { if ((x) == false){ fatal_error("Verify Failed : " #x "\n in %s -> %s : %d", (__FUNCTION__), (__FILE__), __LINE__); os_DebugBreak();}} while (false)
#define die(reason) do { fatal_error("Fatal error : %s\n in %s -> %s : %d", (reason), (__FUNCTION__), (__FILE__), __LINE__); os_DebugBreak();} while (false)
enum class JVS {
Default,

View File

@ -941,7 +941,7 @@ int CALLBACK WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
return 0;
}
void os_DebugBreak()
[[noreturn]] void os_DebugBreak()
{
__debugbreak();
}

View File

@ -532,7 +532,7 @@ extern "C" JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_AudioBackend_set
}
}
void os_DebugBreak()
[[noreturn]] void os_DebugBreak()
{
// TODO: notify the parent thread about it ...

View File

@ -3002,7 +3002,7 @@ void fatal_error(const char* text, ...)
}
}
void os_DebugBreak()
[[noreturn]] void os_DebugBreak()
{
ERROR_LOG(COMMON, "DEBUGBREAK!");
//exit(-1);

View File

@ -3,13 +3,9 @@
#include "types.h"
#ifndef __ANDROID__
void os_DebugBreak()
[[noreturn]] void os_DebugBreak()
{
#ifdef __linux__
raise(SIGTRAP);
#elif defined(_WIN32)
__debugbreak();
#endif
std::abort();
}
#ifdef _WIN32