LibC: Fix some compiler errors

__x86_64__ isn't defined at all on AARCH64.
This commit is contained in:
Gunnar Beutner 2022-10-12 22:19:01 +02:00 committed by Linus Groh
parent 808c43312d
commit a7a71be113
Notes: sideshowbarker 2024-07-18 08:59:31 +09:00

View File

@ -26,7 +26,7 @@ struct __jmp_buf {
uint32_t ebp;
uint32_t esp;
uint32_t eip;
#elif __x86_64__
#elif defined(__x86_64__)
uint64_t rbx;
uint64_t r12;
uint64_t r13;
@ -35,7 +35,7 @@ struct __jmp_buf {
uint64_t rbp;
uint64_t rsp;
uint64_t rip;
#elif __aarch64__
#elif defined(__aarch64__)
// FIXME: This is likely incorrect.
uint64_t regs[22];
#else
@ -54,9 +54,9 @@ typedef struct __jmp_buf sigjmp_buf[1];
#ifdef __cplusplus
# ifdef __i386__
static_assert(sizeof(struct __jmp_buf) == 32, "struct __jmp_buf unsynchronized with i386/setjmp.S");
# elif __x86_64__
# elif defined(__x86_64__)
static_assert(sizeof(struct __jmp_buf) == 72, "struct __jmp_buf unsynchronized with x86_64/setjmp.S");
# elif __aarch64__
# elif defined(__aarch64__)
static_assert(sizeof(struct __jmp_buf) == 184, "struct __jmp_buf unsynchronized with aarch64/setjmp.S");
# else
# error