mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:57:44 +00:00
AK+readelf: Issue error when using ARCH(arch) with nonexistent arch
This disallows erroneous `#if ARCH(x86_64)` (note lowercase x).
This commit is contained in:
parent
11b40dbcf5
commit
4536b80a62
3 changed files with 14 additions and 5 deletions
|
@ -13,14 +13,23 @@
|
|||
|
||||
#ifdef __x86_64__
|
||||
# define AK_ARCH_X86_64 1
|
||||
# define AK_IS_ARCH_X86_64() 1
|
||||
#else
|
||||
# define AK_IS_ARCH_X86_64() 0
|
||||
#endif
|
||||
|
||||
#ifdef __aarch64__
|
||||
# define AK_ARCH_AARCH64 1
|
||||
# define AK_IS_ARCH_AARCH64() 1
|
||||
#else
|
||||
# define AK_IS_ARCH_AARCH64() 0
|
||||
#endif
|
||||
|
||||
#ifdef __wasm32__
|
||||
# define AK_ARCH_WASM32 1
|
||||
# define AK_IS_ARCH_WASM32() 1
|
||||
#else
|
||||
# define AK_IS_ARCH_WASM32() 0
|
||||
#endif
|
||||
|
||||
#if (defined(__SIZEOF_POINTER__) && __SIZEOF_POINTER__ == 8) || defined(_WIN64)
|
||||
|
@ -88,7 +97,7 @@
|
|||
# define AK_OS_EMSCRIPTEN
|
||||
#endif
|
||||
|
||||
#define ARCH(arch) (defined(AK_ARCH_##arch) && AK_ARCH_##arch)
|
||||
#define ARCH(arch) (AK_IS_ARCH_##arch())
|
||||
|
||||
#if ARCH(X86_64)
|
||||
# define VALIDATE_IS_X86()
|
||||
|
@ -192,7 +201,7 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
#ifndef AK_SYSTEM_CACHE_ALIGNMENT_SIZE
|
||||
# if ARCH(AARCH64) || ARCH(x86_64)
|
||||
# if ARCH(AARCH64) || ARCH(X86_64)
|
||||
# define AK_SYSTEM_CACHE_ALIGNMENT_SIZE 64
|
||||
# else
|
||||
# define AK_SYSTEM_CACHE_ALIGNMENT_SIZE 128
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue