Replace MSVC __debugbreak with cross-compiler DEBUG_BREAK macro. (#1540)

This commit is contained in:
ModMaker101
2026-04-26 13:23:52 -04:00
committed by GitHub
parent 3ab29ec26e
commit 585455cef0
73 changed files with 117 additions and 129 deletions

12
Minecraft.World/Debug.h Normal file
View 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