Added BREAK macro

This commit is contained in:
Alex 2022-12-18 16:10:47 +02:00
parent 20f17c574e
commit b0cc8f2f87
Signed by untrusted user who does not match committer: enderice2
GPG Key ID: EACC3AD603BAB4DD

View File

@ -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)