diff --git a/src/resources/macros/debug.h b/src/resources/macros/debug.h new file mode 100644 index 0000000..b0f7d5b --- /dev/null +++ b/src/resources/macros/debug.h @@ -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 + #define BREAKPOINT() raise(SIGTRAP) +#else + #include + #define BREAKPOINT() std::raise(SIGTRAP) +#endif