Skip to content

Commit 019c8b5

Browse files
author
nitrocaster
committed
Reimplement MSVC DEBUG_BREAK macro using __debugbreak intrinsic.
1 parent e13c2c5 commit 019c8b5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Common/Compiler.inl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
#error Unsupported compiler
33
#endif
44

5+
#ifdef _MSC_VER
6+
#include <intrin.h> // for __debugbreak
7+
#endif
8+
59
#if defined(__GNUC__)
610
#define XR_EXPORT __attribute__ ((visibility("default")))
711
#define XR_IMPORT __attribute__ ((visibility("default")))
@@ -19,7 +23,7 @@
1923
#define NO_INLINE __declspec(noinline)
2024
#define FORCE_INLINE __forceinline
2125
#define ALIGN(a) __declspec(align(a))
22-
#define DEBUG_BREAK _asm { int 3 }
26+
#define DEBUG_BREAK __debugbreak()
2327
#define __thread __declspec(thread)
2428
#endif
2529

0 commit comments

Comments
 (0)