diff --git a/AK/Platform.h b/AK/Platform.h index 3ea0dcade6..7b5c28e663 100644 --- a/AK/Platform.h +++ b/AK/Platform.h @@ -148,7 +148,7 @@ #ifdef NAKED # undef NAKED #endif -#ifndef AK_ARCH_AARCH64 +#if !ARCH(AARCH64) # define NAKED __attribute__((naked)) #else # define NAKED diff --git a/AK/StdLibExtraDetails.h b/AK/StdLibExtraDetails.h index 1fef15c4bb..e7c3d7405d 100644 --- a/AK/StdLibExtraDetails.h +++ b/AK/StdLibExtraDetails.h @@ -274,7 +274,7 @@ template<> struct __MakeUnsigned { using Type = bool; }; -#ifdef AK_ARCH_AARCH64 +#if ARCH(AARCH64) template<> struct __MakeUnsigned { using Type = wchar_t; @@ -332,7 +332,7 @@ template<> struct __MakeSigned { using Type = char; }; -#ifdef AK_ARCH_AARCH64 +#if ARCH(AARCH64) template<> struct __MakeSigned { using Type = void; diff --git a/Userland/DynamicLoader/main.cpp b/Userland/DynamicLoader/main.cpp index 5e61355a86..fa39761975 100644 --- a/Userland/DynamicLoader/main.cpp +++ b/Userland/DynamicLoader/main.cpp @@ -62,7 +62,7 @@ void _entry(int, char**, char**) __attribute__((used)); NAKED void _start(int, char**, char**) { -#ifdef AK_ARCH_AARCH64 +#if ARCH(AARCH64) asm( "bl _entry\n"); #else diff --git a/Userland/Libraries/LibC/crt0.cpp b/Userland/Libraries/LibC/crt0.cpp index bbac46095f..72b2c5c930 100644 --- a/Userland/Libraries/LibC/crt0.cpp +++ b/Userland/Libraries/LibC/crt0.cpp @@ -25,7 +25,7 @@ void _start(int, char**, char**) __attribute__((used)); NAKED void _start(int, char**, char**) { -# ifdef AK_ARCH_AARCH64 +# if ARCH(AARCH64) asm( "bl _entry\n"); # else diff --git a/Userland/Libraries/LibC/fenv.cpp b/Userland/Libraries/LibC/fenv.cpp index edc07bcbf6..b00f07f32b 100644 --- a/Userland/Libraries/LibC/fenv.cpp +++ b/Userland/Libraries/LibC/fenv.cpp @@ -10,7 +10,7 @@ // This is the size of the floating point environment image in protected mode static_assert(sizeof(__x87_floating_point_environment) == 28); -#ifndef AK_ARCH_AARCH64 +#if !ARCH(AARCH64) static u16 read_status_register() { u16 status_register; @@ -55,7 +55,7 @@ int fegetenv(fenv_t* env) if (!env) return 1; -#ifdef AK_ARCH_AARCH64 +#if ARCH(AARCH64) (void)env; TODO_AARCH64(); #else @@ -73,7 +73,7 @@ int fesetenv(fenv_t const* env) if (!env) return 1; -#ifdef AK_ARCH_AARCH64 +#if ARCH(AARCH64) (void)env; TODO_AARCH64(); #else @@ -99,7 +99,7 @@ int feholdexcept(fenv_t* env) fenv_t current_env; fegetenv(¤t_env); -#ifdef AK_ARCH_AARCH64 +#if ARCH(AARCH64) (void)env; TODO_AARCH64(); #else @@ -139,7 +139,7 @@ int fesetexceptflag(fexcept_t const* except, int exceptions) fegetenv(¤t_env); exceptions &= FE_ALL_EXCEPT; -#ifdef AK_ARCH_AARCH64 +#if ARCH(AARCH64) (void)exceptions; (void)except; TODO_AARCH64(); @@ -154,7 +154,7 @@ int fesetexceptflag(fexcept_t const* except, int exceptions) int fegetround() { -#ifdef AK_ARCH_AARCH64 +#if ARCH(AARCH64) TODO_AARCH64(); #else // There's no way to signal whether the SSE rounding mode and x87 ones are different, so we assume they're the same @@ -167,7 +167,7 @@ int fesetround(int rounding_mode) if (rounding_mode < FE_TONEAREST || rounding_mode > FE_TOWARDZERO) return 1; -#ifdef AK_ARCH_AARCH64 +#if ARCH(AARCH64) TODO_AARCH64(); #else auto control_word = read_control_word(); @@ -196,7 +196,7 @@ int feclearexcept(int exceptions) fenv_t current_env; fegetenv(¤t_env); -#ifdef AK_ARCH_AARCH64 +#if ARCH(AARCH64) (void)exceptions; TODO_AARCH64(); #else @@ -210,7 +210,7 @@ int feclearexcept(int exceptions) int fetestexcept(int exceptions) { -#ifdef AK_ARCH_AARCH64 +#if ARCH(AARCH64) (void)exceptions; TODO_AARCH64(); #else @@ -228,7 +228,7 @@ int feraiseexcept(int exceptions) exceptions &= FE_ALL_EXCEPT; -#ifdef AK_ARCH_AARCH64 +#if ARCH(AARCH64) (void)exceptions; TODO_AARCH64(); #else diff --git a/Userland/Libraries/LibC/math.cpp b/Userland/Libraries/LibC/math.cpp index f7ad62996e..b0031584d9 100644 --- a/Userland/Libraries/LibC/math.cpp +++ b/Userland/Libraries/LibC/math.cpp @@ -10,7 +10,7 @@ #include #include #include -#ifndef AK_ARCH_AARCH64 +#if !ARCH(AARCH64) # include #endif #include @@ -364,7 +364,7 @@ MAKE_AK_BACKED2(remainder); long double truncl(long double x) NOEXCEPT { -#ifndef AK_ARCH_AARCH64 +#if !ARCH(AARCH64) if (fabsl(x) < LONG_LONG_MAX) { // This is 1.6 times faster than the implementation using the "internal_to_integer" // helper (on x86_64) @@ -384,7 +384,7 @@ long double truncl(long double x) NOEXCEPT double trunc(double x) NOEXCEPT { -#ifndef AK_ARCH_AARCH64 +#if !ARCH(AARCH64) if (fabs(x) < LONG_LONG_MAX) { u64 temp; asm( @@ -401,7 +401,7 @@ double trunc(double x) NOEXCEPT float truncf(float x) NOEXCEPT { -#ifndef AK_ARCH_AARCH64 +#if !ARCH(AARCH64) if (fabsf(x) < LONG_LONG_MAX) { u64 temp; asm( @@ -418,7 +418,7 @@ float truncf(float x) NOEXCEPT long double rintl(long double value) { -#ifdef AK_ARCH_AARCH64 +#if ARCH(AARCH64) (void)value; TODO_AARCH64(); #else @@ -432,7 +432,7 @@ long double rintl(long double value) } double rint(double value) { -#ifdef AK_ARCH_AARCH64 +#if ARCH(AARCH64) (void)value; TODO_AARCH64(); #else @@ -446,7 +446,7 @@ double rint(double value) } float rintf(float value) { -#ifdef AK_ARCH_AARCH64 +#if ARCH(AARCH64) (void)value; TODO_AARCH64(); #else @@ -461,7 +461,7 @@ float rintf(float value) long lrintl(long double value) { -#ifdef AK_ARCH_AARCH64 +#if ARCH(AARCH64) (void)value; TODO_AARCH64(); #else @@ -476,7 +476,7 @@ long lrintl(long double value) } long lrint(double value) { -#ifdef AK_ARCH_AARCH64 +#if ARCH(AARCH64) (void)value; TODO_AARCH64(); #else @@ -491,7 +491,7 @@ long lrint(double value) } long lrintf(float value) { -#ifdef AK_ARCH_AARCH64 +#if ARCH(AARCH64) (void)value; TODO_AARCH64(); #else @@ -507,7 +507,7 @@ long lrintf(float value) long long llrintl(long double value) { -#ifdef AK_ARCH_AARCH64 +#if ARCH(AARCH64) (void)value; TODO_AARCH64(); #else @@ -522,7 +522,7 @@ long long llrintl(long double value) } long long llrint(double value) { -#ifdef AK_ARCH_AARCH64 +#if ARCH(AARCH64) (void)value; TODO_AARCH64(); #else @@ -537,7 +537,7 @@ long long llrint(double value) } long long llrintf(float value) { -#ifdef AK_ARCH_AARCH64 +#if ARCH(AARCH64) (void)value; TODO_AARCH64(); #else diff --git a/Userland/Libraries/LibELF/DynamicLinker.cpp b/Userland/Libraries/LibELF/DynamicLinker.cpp index 413b6aee6e..549d3cf809 100644 --- a/Userland/Libraries/LibELF/DynamicLinker.cpp +++ b/Userland/Libraries/LibELF/DynamicLinker.cpp @@ -684,7 +684,7 @@ void ELF::DynamicLinker::linker_main(DeprecatedString&& main_program_path, int m dbgln_if(DYNAMIC_LOAD_DEBUG, "Jumping to entry point: {:p}", entry_point_function); if (s_do_breakpoint_trap_before_entry) { -#ifdef AK_ARCH_AARCH64 +#if ARCH(AARCH64) asm("brk #0"); #else asm("int3");