diff --git a/AK/Assertions.h b/AK/Assertions.h index 9f75f78eec..7327d52cf4 100644 --- a/AK/Assertions.h +++ b/AK/Assertions.h @@ -25,4 +25,5 @@ extern "C" __attribute__((noreturn)) void ak_verification_failed(char const*); static constexpr bool TODO = false; # define TODO() VERIFY(TODO) /* NOLINT(cert-dcl03-c,misc-static-assert) No, this can't be static_assert, it's a runtime check */ # define TODO_AARCH64() VERIFY(TODO) /* NOLINT(cert-dcl03-c,misc-static-assert) No, this can't be static_assert, it's a runtime check */ +# define TODO_RISCV64() VERIFY(TODO) /* NOLINT(cert-dcl03-c,misc-static-assert) No, this can't be static_assert, it's a runtime check */ #endif diff --git a/AK/Platform.h b/AK/Platform.h index ec5cc454ee..23fa7d28a2 100644 --- a/AK/Platform.h +++ b/AK/Platform.h @@ -23,6 +23,12 @@ # define AK_IS_ARCH_AARCH64() 0 #endif +#if defined(__riscv) && __riscv_xlen == 64 +# define AK_IS_ARCH_RISCV64() 1 +#else +# define AK_IS_ARCH_RISCV64() 0 +#endif + #ifdef __wasm32__ # define AK_IS_ARCH_WASM32() 1 #else @@ -113,6 +119,12 @@ # define VALIDATE_IS_AARCH64() static_assert(false, "Trying to include aarch64 only header on non aarch64 platform"); #endif +#if ARCH(RISCV64) +# define VALIDATE_IS_RISCV64() +#else +# define VALIDATE_IS_RISCV64() static_assert(false, "Trying to include riscv64 only header on non riscv64 platform"); +#endif + #if !defined(AK_COMPILER_CLANG) # define AK_HAS_CONDITIONALLY_TRIVIAL #endif