1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:07:34 +00:00

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.
This commit is contained in:
Nico Weber 2022-10-04 15:04:13 -04:00 committed by Linus Groh
parent ff4b912b7c
commit 2af028132a
35 changed files with 64 additions and 49 deletions

View file

@ -751,7 +751,7 @@ public:
private:
};
#ifdef __clang__
#if defined(AK_COMPILER_CLANG)
#pragma clang diagnostic pop
#endif)~~~");
}
@ -781,7 +781,7 @@ void build(StringBuilder& builder, Vector<Endpoint> const& endpoints)
#include <LibIPC/Message.h>
#include <LibIPC/Stub.h>
#ifdef __clang__
#if defined(AK_COMPILER_CLANG)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdefaulted-function-deleted"
#endif)~~~");

View file

@ -199,7 +199,7 @@ static CodePointRange parse_code_point_range(StringView list)
}
// gcc-11, gcc-12 have a codegen bug on (at least) intel macOS 10.15, see #15449.
#if defined(__GNUC__) && !defined(__clang__) && defined(AK_OS_MACOS)
#if defined(AK_COMPILER_GCC) && defined(AK_OS_MACOS)
# pragma GCC push_options
# pragma GCC optimize("O0")
#endif
@ -649,7 +649,7 @@ static ErrorOr<void> parse_unicode_data(Core::Stream::BufferedFile& file, Unicod
return {};
}
#if defined(__GNUC__) && !defined(__clang__) && defined(AK_OS_MACOS)
#if defined(AK_COMPILER_GCC) && defined(AK_OS_MACOS)
# pragma GCC pop_options
#endif