Removed _debugBreak() again, as there is already MIJIN_TRAP().
This commit is contained in:
parent
522e6534bf
commit
54c63cfe69
@ -8,18 +8,16 @@
|
|||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <source_location>
|
#include <source_location>
|
||||||
|
|
||||||
#if MIJIN_DEBUG
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#pragma comment(lib, "kernel32")
|
#pragma comment(lib, "kernel32")
|
||||||
extern "C" __declspec(dllimport) void __stdcall DebugBreak();
|
extern "C" __declspec(dllimport) void __stdcall DebugBreak();
|
||||||
#define MIJIN_TRAP() DebugBreak()
|
#define MIJIN_TRAP() DebugBreak()
|
||||||
#define MIJIN_FUNC() __FUNCSIG__
|
#define MIJIN_FUNC() __FUNCSIG__
|
||||||
#else // _WIN32
|
#else // _WIN32
|
||||||
#include <signal.h>
|
#include <csignal>
|
||||||
#define MIJIN_TRAP() raise(SIGTRAP)
|
#define MIJIN_TRAP() (void) std::raise(SIGTRAP)
|
||||||
#define MIJIN_FUNC() "" // TODO: __PRETTY_FUNCTION__ is not working for some reason -.-
|
#define MIJIN_FUNC() "" // TODO: __PRETTY_FUNCTION__ is not working for some reason -.-
|
||||||
#endif // !_WIN32
|
#endif // !_WIN32
|
||||||
#endif // MIJIN_DEBUG
|
|
||||||
|
|
||||||
namespace mijin
|
namespace mijin
|
||||||
{
|
{
|
||||||
|
@ -44,16 +44,4 @@ void setCurrentThreadName(const char* threadName) noexcept;
|
|||||||
|
|
||||||
} // namespace mijin
|
} // 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)
|
#endif // !defined(MIJIN_UTIL_OS_HPP_INCLUDED)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user