Replace MSVC __debugbreak with cross-compiler DEBUG_BREAK macro. (#1540)
This commit is contained in:
12
Minecraft.World/Debug.h
Normal file
12
Minecraft.World/Debug.h
Normal file
@@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
#include <csignal>
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#define DEBUG_BREAK() __debugbreak()
|
||||
#elif defined(__GNUC__) || defined(__clang__)
|
||||
#define DEBUG_BREAK() __builtin_trap()
|
||||
#elif defined(SIGTRAP)
|
||||
#define DEBUG_BREAK() std::raise(SIGTRAP)
|
||||
#else
|
||||
#define DEBUG_BREAK() ((void)0)
|
||||
#endif
|
||||
Reference in New Issue
Block a user