Removed _debugBreak() again, as there is already MIJIN_TRAP().

This commit is contained in:
Patrick 2023-11-01 23:53:50 +01:00
parent 522e6534bf
commit 54c63cfe69
2 changed files with 2 additions and 16 deletions

View File

@ -8,18 +8,16 @@
#include <cstdlib>
#include <source_location>
#if MIJIN_DEBUG
#ifdef _WIN32
#pragma comment(lib, "kernel32")
extern "C" __declspec(dllimport) void __stdcall DebugBreak();
#define MIJIN_TRAP() DebugBreak()
#define MIJIN_FUNC() __FUNCSIG__
#else // _WIN32
#include <signal.h>
#define MIJIN_TRAP() raise(SIGTRAP)
#include <csignal>
#define MIJIN_TRAP() (void) std::raise(SIGTRAP)
#define MIJIN_FUNC() "" // TODO: __PRETTY_FUNCTION__ is not working for some reason -.-
#endif // !_WIN32
#endif // MIJIN_DEBUG
namespace mijin
{

View File

@ -44,16 +44,4 @@ void setCurrentThreadName(const char* threadName) noexcept;
} // namespace mijin
#if MIJIN_TARGET_OS == MIJIN_OS_LINUX || MIJIN_TARGET_OS == MIJIN_OS_OSX
#if !defined(SIGTRAP)
static constexpr int SIGTRAP = 5;
#endif
#define _debugBreak() (void) std::raise(SIGTRAP)
#elif MIJIN_TARGET_OS == MIJIN_OS_WINDOWS
extern "C" __declspec(dllimport) void __stdcall DebugBreak();
#define _debugBreak() DebugBreak()
#else
#define _debugBreak() ((void)0)
#endif
#endif // !defined(MIJIN_UTIL_OS_HPP_INCLUDED)