From df8df947f64bc3e240c47d81b19476d40b0e2b18 Mon Sep 17 00:00:00 2001 From: SeekingBlues Date: Sun, 29 May 2022 22:51:34 -0500 Subject: [PATCH] Kernel: Do not include AK/Platform.h in mcontext headers Including signal.h would cause several ports to fail on build, because it would end up including AK/Platform.h through these mcontext headers. This is problematic because AK/Platform.h defines several macros with very common names, such as `NAKED` (breaks radare2), and `NO_SANITIZE_ADDRESS` and `ALWAYS_INLINE` (breaks ruby). --- Kernel/Arch/aarch64/mcontext.h | 1 - Kernel/Arch/mcontext.h | 6 ++---- Kernel/Arch/x86/mcontext.h | 3 +-- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Kernel/Arch/aarch64/mcontext.h b/Kernel/Arch/aarch64/mcontext.h index c4ebbabab18..57e7182c841 100644 --- a/Kernel/Arch/aarch64/mcontext.h +++ b/Kernel/Arch/aarch64/mcontext.h @@ -6,7 +6,6 @@ #pragma once -#include #include #ifdef __cplusplus diff --git a/Kernel/Arch/mcontext.h b/Kernel/Arch/mcontext.h index ff9aa4b5aeb..95d35a0d7e8 100644 --- a/Kernel/Arch/mcontext.h +++ b/Kernel/Arch/mcontext.h @@ -6,10 +6,8 @@ #pragma once -#include - -#if ARCH(X86_64) || ARCH(I386) +#if defined(__i386__) || defined(__x86_64__) # include -#elif ARCH(AARCH64) +#elif defined(__aarch64__) # include #endif diff --git a/Kernel/Arch/x86/mcontext.h b/Kernel/Arch/x86/mcontext.h index a01376ef981..b2755dd431b 100644 --- a/Kernel/Arch/x86/mcontext.h +++ b/Kernel/Arch/x86/mcontext.h @@ -6,7 +6,6 @@ #pragma once -#include #include #ifdef __cplusplus @@ -14,7 +13,7 @@ extern "C" { #endif struct __attribute__((packed)) __mcontext { -#if ARCH(I386) +#ifdef __i386__ uint32_t eax; uint32_t ecx; uint32_t edx;