diff options
| author | WormHeamer | 2025-12-27 06:02:21 -0500 |
|---|---|---|
| committer | WormHeamer | 2025-12-27 06:02:21 -0500 |
| commit | 03982ee954c5fd216f5c2383b63421526fc49559 (patch) | |
| tree | 42243a70966f1081e3c3c87ed3576ed28cdcac57 | |
| parent | 399aec56ac13aad6d07fcb2bfaeedb061a56cf5f (diff) | |
better debug traps
| -rw-r--r-- | wrmr.h | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -25,7 +25,15 @@ typedef uintptr_t uptr; #define BESTRING_(x) #x #define BESTRING(x) BESTRING_(x) -#if defined(__GNUC__) +#ifdef __has_builtin +#define HAS_BUILTIN(x) __has_builtin(x) +#else +#define HAS_BUILTIN(x) 0 +#endif + +#if HAS_BUILTIN(__builtin_debugtrap) +# define TRAP() __builtin_debugtrap() +#elif HAS_BUILTIN(__builtin_trap) # define TRAP() __builtin_trap() #elif defined(_MSC_VER) # define TRAP() __debugbreak() |
