feat(macros): added BREAKPOINT() macro to set a breakpoint in code
This commit is contained in:
11
src/resources/macros/debug.h
Normal file
11
src/resources/macros/debug.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#ifdef __GNUC__ // GCC and Clang
|
||||
#define BREAKPOINT() __builtin_debugtrap()
|
||||
#elif defined(_MSC_VER) // MSVC
|
||||
#define BREAKPOINT() __debugbreak()
|
||||
#elif defined(__APPLE__) && defined(__MACH__) // macOS with Clang and LLDB
|
||||
#include <signal.h>
|
||||
#define BREAKPOINT() raise(SIGTRAP)
|
||||
#else
|
||||
#include <csignal>
|
||||
#define BREAKPOINT() std::raise(SIGTRAP)
|
||||
#endif
|
||||
Reference in New Issue
Block a user