diff --git a/src/xrt/include/xrt/xrt_compiler.h b/src/xrt/include/xrt/xrt_compiler.h index 344cb8927..69e69b028 100644 --- a/src/xrt/include/xrt/xrt_compiler.h +++ b/src/xrt/include/xrt/xrt_compiler.h @@ -42,3 +42,14 @@ #else #define XRT_MAYBE_UNUSED #endif + +/*! + * @define XRT_DEBUGBREAK() + * To trigger a trap/break in the debugger. + */ +#if defined(__clang__) || defined(__GNUC__) +#define XRT_DEBUGBREAK() __builtin_trap() +#elif defined(_MSC_VER) +#include +#define XRT_DEBUGBREAK() __debugbreak() +#endif