feat(macros): added BREAKPOINT() macro to set a breakpoint in code

This commit is contained in:
2025-03-19 13:48:26 -04:00
parent 0ec1b6e751
commit 2680502465

View 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