mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-09 09:34:57 +09: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:
parent
ff4b912b7c
commit
2af028132a
Notes:
sideshowbarker
2024-07-17 06:21:46 +09:00
Author: https://github.com/nico
Commit: 2af028132a
Pull-request: https://github.com/SerenityOS/serenity/pull/15476
Reviewed-by: https://github.com/linusg ✅
35 changed files with 64 additions and 49 deletions
|
@ -302,7 +302,7 @@ public:
|
|||
template<typename U, typename V>
|
||||
[[nodiscard]] static constexpr bool addition_would_overflow(U u, V v)
|
||||
{
|
||||
#ifdef __clang__
|
||||
#if defined(AK_COMPILER_CLANG)
|
||||
Checked checked;
|
||||
checked = u;
|
||||
checked += v;
|
||||
|
@ -315,7 +315,7 @@ public:
|
|||
template<typename U, typename V>
|
||||
[[nodiscard]] static constexpr bool multiplication_would_overflow(U u, V v)
|
||||
{
|
||||
#ifdef __clang__
|
||||
#if defined(AK_COMPILER_CLANG)
|
||||
Checked checked;
|
||||
checked = u;
|
||||
checked *= v;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue