From 03fd9002da4a0dab59be7377d11515c63cc07ab7 Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Sun, 27 Nov 2022 16:35:35 +0100 Subject: [PATCH] AK: Export Details and Concepts into the AK namespace AK internals like to use concepts and details without a fully qualified name, which usually works just fine because we make everything AK-related available to the unqualified namespace. However, this breaks as soon as we start not using `USING_AK_GLOBALLY`, due to those identifiers no longer being made available. Instead, we just export those into the `AK` namespace instead. --- AK/Concepts.h | 6 +++++- AK/StdLibExtraDetails.h | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/AK/Concepts.h b/AK/Concepts.h index aaa1348cc7..f419990e2d 100644 --- a/AK/Concepts.h +++ b/AK/Concepts.h @@ -121,7 +121,9 @@ concept FallibleFunction = requires(Func&& func, Args&&... args) { // clang-format on } -#if USING_AK_GLOBALLY +#if !USING_AK_GLOBALLY +namespace AK { +#endif using AK::Concepts::Arithmetic; using AK::Concepts::ArrayLike; using AK::Concepts::Enum; @@ -139,4 +141,6 @@ using AK::Concepts::Signed; using AK::Concepts::SpecializationOf; using AK::Concepts::Unsigned; using AK::Concepts::VoidFunction; +#if !USING_AK_GLOBALLY +} #endif diff --git a/AK/StdLibExtraDetails.h b/AK/StdLibExtraDetails.h index 68689d8c83..69c3669ada 100644 --- a/AK/StdLibExtraDetails.h +++ b/AK/StdLibExtraDetails.h @@ -615,7 +615,9 @@ inline constexpr bool IsOneOfIgnoringCV = (IsSameIgnoringCV || ...); } -#if USING_AK_GLOBALLY +#if !USING_AK_GLOBALLY +namespace AK { +#endif using AK::Detail::AddConst; using AK::Detail::AddConstToReferencedType; using AK::Detail::AddLvalueReference; @@ -685,4 +687,6 @@ using AK::Detail::RemoveVolatile; using AK::Detail::TrueType; using AK::Detail::UnderlyingType; using AK::Detail::Void; +#if !USING_AK_GLOBALLY +} #endif