From b0cc8f2f8792a28a2fd7220492645af4c6da040b Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 18 Dec 2022 16:10:47 +0200 Subject: [PATCH] Added BREAK macro --- include/types.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/include/types.h b/include/types.h index 446bc88..019cda2 100644 --- a/include/types.h +++ b/include/types.h @@ -200,6 +200,23 @@ typedef __SIZE_TYPE__ size_t; #define WINT_MAX __WINT_MAX__ #define WINT_MIN __WINT_MIN__ +#if defined(__amd64__) +#define BREAK __asm__ __volatile__("int $0x3" \ + : \ + : \ + : "memory"); +#elif defined(__i386__) +#define BREAK __asm__ __volatile__("int $0x3" \ + : \ + : \ + : "memory"); +#elif defined(__aarch64__) +#define BREAK __asm__ __volatile__("brk #0" \ + : \ + : \ + : "memory"); +#endif + #define b4(x) ((x & 0x0F) << 4 | (x & 0xF0) >> 4) #define b8(x) ((x)&0xFF) #define b16(x) __builtin_bswap16(x)