diff options
author | Nico Weber <thakis@chromium.org> | 2022-10-04 15:04:13 -0400 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-10-04 23:35:07 +0100 |
commit | 2af028132adca1ae9fbb81a655a9ce00420d8ad4 (patch) | |
tree | af00557114ea1bc3463ae163b0b3dc7c026ccc69 /Userland/Libraries/LibC | |
parent | ff4b912b7cc302b2ca1b49e3156b565bc4811106 (diff) | |
download | serenity-2af028132adca1ae9fbb81a655a9ce00420d8ad4.zip |
AK+Everywhere: Add AK_COMPILER_{GCC,CLANG} and use them most places
Doesn't use them in libc headers so that those don't have to pull in
AK/Platform.h.
AK_COMPILER_GCC is set _only_ for gcc, not for clang too. (__GNUC__ is
defined in clang builds as well.) Using AK_COMPILER_GCC simplifies
things some.
AK_COMPILER_CLANG isn't as much of a win, other than that it's
consistent with AK_COMPILER_GCC.
Diffstat (limited to 'Userland/Libraries/LibC')
-rw-r--r-- | Userland/Libraries/LibC/arch/x86_64/memset.cpp | 2 | ||||
-rw-r--r-- | Userland/Libraries/LibC/math.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Libraries/LibC/arch/x86_64/memset.cpp b/Userland/Libraries/LibC/arch/x86_64/memset.cpp index a5e58a2d5b..8ff6667e6f 100644 --- a/Userland/Libraries/LibC/arch/x86_64/memset.cpp +++ b/Userland/Libraries/LibC/arch/x86_64/memset.cpp @@ -41,7 +41,7 @@ namespace { } } -#if !defined(__clang__) && !defined(_DYNAMIC_LOADER) +#if !defined(AK_COMPILER_CLANG) && !defined(_DYNAMIC_LOADER) [[gnu::ifunc("resolve_memset")]] void* memset(void*, int, size_t); #else // DynamicLoader can't self-relocate IFUNCs. diff --git a/Userland/Libraries/LibC/math.cpp b/Userland/Libraries/LibC/math.cpp index 9472fff710..df1e409ce1 100644 --- a/Userland/Libraries/LibC/math.cpp +++ b/Userland/Libraries/LibC/math.cpp @@ -19,7 +19,7 @@ #include <stdint.h> #include <stdlib.h> -#ifdef __clang__ +#if defined(AK_COMPILER_CLANG) # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wdouble-promotion" #endif @@ -1148,6 +1148,6 @@ float nearbyintf(float value) NOEXCEPT } } -#ifdef __clang__ +#if defined(AK_COMPILER_CLANG) # pragma clang diagnostic pop #endif |