From b8401302be214203af946f5642504d4efabd7b39 Mon Sep 17 00:00:00 2001 From: Lars Immisch Date: Tue, 26 Sep 2023 22:17:27 +0200 Subject: [PATCH] types: Expand RE_BREAKPOINT macro to __builtin_debugtrap (#961) --- include/re_types.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/re_types.h b/include/re_types.h index a3c4dba56..35d9d5992 100644 --- a/include/re_types.h +++ b/include/re_types.h @@ -81,7 +81,13 @@ typedef SSIZE_T ssize_t; /** Defines a soft breakpoint */ #if (defined(__i386__) || defined(__x86_64__)) #define RE_BREAKPOINT __asm__("int $0x03") -#else +#elif defined(__has_builtin) +#if __has_builtin(__builtin_debugtrap) +#define RE_BREAKPOINT __builtin_debugtrap() +#endif +#endif + +#ifndef RE_BREAKPOINT #define RE_BREAKPOINT #endif