Skip to content

Commit

Permalink
Reimplement MSVC DEBUG_BREAK macro using __debugbreak intrinsic.
Browse files Browse the repository at this point in the history
  • Loading branch information
nitrocaster committed Feb 28, 2016
1 parent e13c2c5 commit 019c8b5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Common/Compiler.inl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
#error Unsupported compiler
#endif

#ifdef _MSC_VER
#include <intrin.h> // for __debugbreak
#endif

#if defined(__GNUC__)
#define XR_EXPORT __attribute__ ((visibility("default")))
#define XR_IMPORT __attribute__ ((visibility("default")))
Expand All @@ -19,7 +23,7 @@
#define NO_INLINE __declspec(noinline)
#define FORCE_INLINE __forceinline
#define ALIGN(a) __declspec(align(a))
#define DEBUG_BREAK _asm { int 3 }
#define DEBUG_BREAK __debugbreak()
#define __thread __declspec(thread)
#endif

Expand Down

0 comments on commit 019c8b5

Please sign in to comment.