From ae3ffdd521a7c7d1fd4b47f9bbfbfaf20da5a14d Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 26 Nov 2022 12:18:30 +0100 Subject: [PATCH] AK: Make it possible to not `using` AK classes into the global namespace This patch adds the `USING_AK_GLOBALLY` macro which is enabled by default, but can be overridden by build flags. This is a step towards integrating Jakt and AK types. --- AK/AllOf.h | 2 ++ AK/AnyOf.h | 2 ++ AK/ArbitrarySizedEnum.h | 2 ++ AK/Array.h | 2 ++ AK/Atomic.h | 2 ++ AK/AtomicRefCounted.h | 2 ++ AK/Badge.h | 4 ++++ AK/Base64.h | 2 ++ AK/BinaryHeap.h | 2 ++ AK/BinarySearch.h | 2 ++ AK/BitCast.h | 4 ++++ AK/BitStream.h | 2 ++ AK/Bitmap.h | 2 ++ AK/BitmapView.h | 2 ++ AK/Buffered.h | 2 ++ AK/BumpAllocator.h | 2 ++ AK/ByteReader.h | 2 ++ AK/CharacterTypes.h | 2 ++ AK/Checked.h | 2 ++ AK/CircularDeque.h | 2 ++ AK/CircularDuplexStream.h | 2 ++ AK/CircularQueue.h | 2 ++ AK/Complex.h | 2 ++ AK/Concepts.h | 2 ++ AK/DateConstants.h | 2 ++ AK/DateTimeLexer.h | 2 ++ AK/Demangle.h | 2 ++ AK/DisjointChunks.h | 2 ++ AK/DistinctNumeric.h | 2 ++ AK/DoublyLinkedList.h | 2 ++ AK/Endian.h | 2 ++ AK/Error.h | 2 ++ AK/FileStream.h | 2 ++ AK/FixedArray.h | 2 ++ AK/FixedPoint.h | 2 ++ AK/FloatingPoint.h | 2 ++ AK/FloatingPointStringConversions.h | 2 ++ AK/FlyString.h | 2 ++ AK/Format.h | 19 +++++++++++-------- AK/Forward.h | 5 ++++- AK/Function.h | 2 ++ AK/FuzzyMatch.h | 2 ++ AK/GenericLexer.h | 2 ++ AK/GenericShorthands.h | 4 ++++ AK/HashMap.h | 2 ++ AK/HashTable.h | 3 +++ AK/Hex.h | 2 ++ AK/IDAllocator.h | 2 ++ AK/IPv4Address.h | 2 ++ AK/IPv6Address.h | 2 ++ AK/IntrusiveList.h | 2 ++ AK/IntrusiveListRelaxedConst.h | 2 ++ AK/IntrusiveRedBlackTree.h | 2 ++ AK/IterationDecision.h | 4 ++++ AK/JsonArray.h | 2 ++ AK/JsonArraySerializer.h | 2 ++ AK/JsonObject.h | 2 ++ AK/JsonObjectSerializer.h | 2 ++ AK/JsonParser.h | 2 ++ AK/JsonPath.h | 2 ++ AK/JsonValue.h | 2 ++ AK/LEB128.h | 2 ++ AK/LexicalPath.h | 2 ++ AK/Math.h | 2 ++ AK/Memory.h | 2 ++ AK/MemoryStream.h | 2 ++ AK/NeverDestroyed.h | 2 ++ AK/NoAllocationGuard.h | 2 ++ AK/NonnullOwnPtr.h | 6 ++++-- AK/NonnullOwnPtrVector.h | 2 ++ AK/NonnullRefPtr.h | 2 ++ AK/NonnullRefPtrVector.h | 2 ++ AK/NumberFormat.h | 2 ++ AK/NumericLimits.h | 2 ++ AK/Optional.h | 2 ++ AK/OwnPtr.h | 2 ++ AK/Platform.h | 6 +++++- AK/Ptr32.h | 2 ++ AK/Queue.h | 2 ++ AK/QuickSort.h | 2 ++ AK/Random.h | 2 ++ AK/RecursionDecision.h | 2 ++ AK/RedBlackTree.h | 2 ++ AK/RefCountForwarder.h | 2 ++ AK/RefCounted.h | 2 ++ AK/RefPtr.h | 2 ++ AK/Result.h | 2 ++ AK/ScopeGuard.h | 2 ++ AK/ScopeLogger.h | 2 ++ AK/ScopedValueRollback.h | 2 ++ AK/Singleton.h | 2 ++ AK/SinglyLinkedList.h | 2 ++ AK/SinglyLinkedListWithCount.h | 2 ++ AK/SourceGenerator.h | 2 ++ AK/SourceLocation.h | 2 ++ AK/Span.h | 2 ++ AK/Stack.h | 2 ++ AK/StackInfo.h | 2 ++ AK/StdLibExtraDetails.h | 3 +++ AK/StdLibExtras.h | 2 ++ AK/String.h | 2 ++ AK/StringBuilder.h | 2 ++ AK/StringFloatingPointConversions.h | 2 ++ AK/StringHash.h | 2 ++ AK/StringImpl.h | 2 ++ AK/StringUtils.h | 2 ++ AK/StringView.h | 2 ++ AK/TemporaryChange.h | 4 ++++ AK/Time.h | 2 ++ AK/Traits.h | 2 ++ AK/Trie.h | 2 ++ AK/Tuple.h | 2 ++ AK/TypeCasts.h | 2 ++ AK/TypeList.h | 2 ++ AK/URLParser.h | 2 ++ AK/UUID.h | 2 ++ AK/Userspace.h | 2 ++ AK/Utf16View.h | 2 ++ AK/Utf32View.h | 2 ++ AK/Utf8View.h | 2 ++ AK/Variant.h | 2 ++ AK/Vector.h | 2 ++ AK/WeakPtr.h | 2 ++ AK/Weakable.h | 2 ++ 124 files changed, 276 insertions(+), 12 deletions(-) diff --git a/AK/AllOf.h b/AK/AllOf.h index b91df51f5c9..ba857f377d8 100644 --- a/AK/AllOf.h +++ b/AK/AllOf.h @@ -32,4 +32,6 @@ template } +#if USING_AK_GLOBALLY using AK::all_of; +#endif diff --git a/AK/AnyOf.h b/AK/AnyOf.h index fabc0efc972..9697c5ddd12 100644 --- a/AK/AnyOf.h +++ b/AK/AnyOf.h @@ -29,4 +29,6 @@ template } +#if USING_AK_GLOBALLY using AK::any_of; +#endif diff --git a/AK/ArbitrarySizedEnum.h b/AK/ArbitrarySizedEnum.h index d176522fa8b..c9a4d0c5cb1 100644 --- a/AK/ArbitrarySizedEnum.h +++ b/AK/ArbitrarySizedEnum.h @@ -123,4 +123,6 @@ struct ArbitrarySizedEnum : public T { } +#if USING_AK_GLOBALLY using AK::ArbitrarySizedEnum; +#endif diff --git a/AK/Array.h b/AK/Array.h index d4aa6791b8d..640de1bbac8 100644 --- a/AK/Array.h +++ b/AK/Array.h @@ -111,5 +111,7 @@ constexpr static auto iota_array(T const offset = {}) } +#if USING_AK_GLOBALLY using AK::Array; using AK::iota_array; +#endif diff --git a/AK/Atomic.h b/AK/Atomic.h index ec0b20f945f..81bbe8169f5 100644 --- a/AK/Atomic.h +++ b/AK/Atomic.h @@ -442,5 +442,7 @@ public: }; } +#if USING_AK_GLOBALLY using AK::Atomic; using AK::full_memory_barrier; +#endif diff --git a/AK/AtomicRefCounted.h b/AK/AtomicRefCounted.h index 50f057231f3..a0ba860b0f4 100644 --- a/AK/AtomicRefCounted.h +++ b/AK/AtomicRefCounted.h @@ -83,5 +83,7 @@ public: } +#if USING_AK_GLOBALLY using AK::AtomicRefCounted; using AK::AtomicRefCountedBase; +#endif diff --git a/AK/Badge.h b/AK/Badge.h index 6b3fdb09dc5..34ca5d369be 100644 --- a/AK/Badge.h +++ b/AK/Badge.h @@ -6,6 +6,8 @@ #pragma once +#include + namespace AK { template @@ -26,4 +28,6 @@ private: } +#if USING_AK_GLOBALLY using AK::Badge; +#endif diff --git a/AK/Base64.h b/AK/Base64.h index 52396fe0578..ae9c428125a 100644 --- a/AK/Base64.h +++ b/AK/Base64.h @@ -22,5 +22,7 @@ namespace AK { [[nodiscard]] String encode_base64(ReadonlyBytes); } +#if USING_AK_GLOBALLY using AK::decode_base64; using AK::encode_base64; +#endif diff --git a/AK/BinaryHeap.h b/AK/BinaryHeap.h index ecca946d50e..56d82bf8263 100644 --- a/AK/BinaryHeap.h +++ b/AK/BinaryHeap.h @@ -108,4 +108,6 @@ private: } +#if USING_AK_GLOBALLY using AK::BinaryHeap; +#endif diff --git a/AK/BinarySearch.h b/AK/BinarySearch.h index f5e8f666cf3..f2ce933caf5 100644 --- a/AK/BinarySearch.h +++ b/AK/BinarySearch.h @@ -67,4 +67,6 @@ constexpr auto binary_search( } +#if USING_AK_GLOBALLY using AK::binary_search; +#endif diff --git a/AK/BitCast.h b/AK/BitCast.h index 06b7b11879d..a893bb858b0 100644 --- a/AK/BitCast.h +++ b/AK/BitCast.h @@ -6,6 +6,8 @@ #pragma once +#include + namespace AK { template @@ -24,4 +26,6 @@ template } +#if USING_AK_GLOBALLY using AK::bit_cast; +#endif diff --git a/AK/BitStream.h b/AK/BitStream.h index a605bdfef5c..ec6a638e097 100644 --- a/AK/BitStream.h +++ b/AK/BitStream.h @@ -239,5 +239,7 @@ private: } +#if USING_AK_GLOBALLY using AK::InputBitStream; using AK::OutputBitStream; +#endif diff --git a/AK/Bitmap.h b/AK/Bitmap.h index 93a14dc1c34..d39fd018423 100644 --- a/AK/Bitmap.h +++ b/AK/Bitmap.h @@ -191,4 +191,6 @@ private: } +#if USING_AK_GLOBALLY using AK::Bitmap; +#endif diff --git a/AK/BitmapView.h b/AK/BitmapView.h index b5d470b747d..3e026db2b49 100644 --- a/AK/BitmapView.h +++ b/AK/BitmapView.h @@ -369,4 +369,6 @@ protected: } +#if USING_AK_GLOBALLY using AK::BitmapView; +#endif diff --git a/AK/Buffered.h b/AK/Buffered.h index 5eec15d544e..dbd446713ea 100644 --- a/AK/Buffered.h +++ b/AK/Buffered.h @@ -194,4 +194,6 @@ private: }; } +#if USING_AK_GLOBALLY using AK::Buffered; +#endif diff --git a/AK/BumpAllocator.h b/AK/BumpAllocator.h index e0796319617..73393b2f021 100644 --- a/AK/BumpAllocator.h +++ b/AK/BumpAllocator.h @@ -197,5 +197,7 @@ inline Atomic BumpAllocator::s_unused_allocation_cache } +#if USING_AK_GLOBALLY using AK::BumpAllocator; using AK::UniformBumpAllocator; +#endif diff --git a/AK/ByteReader.h b/AK/ByteReader.h index d981b69c865..fc453ef6241 100644 --- a/AK/ByteReader.h +++ b/AK/ByteReader.h @@ -55,4 +55,6 @@ struct ByteReader { } +#if USING_AK_GLOBALLY using AK::ByteReader; +#endif diff --git a/AK/CharacterTypes.h b/AK/CharacterTypes.h index 33d59f41644..6748a505c34 100644 --- a/AK/CharacterTypes.h +++ b/AK/CharacterTypes.h @@ -172,6 +172,7 @@ constexpr u32 to_ascii_base36_digit(u32 digit) } +#if USING_AK_GLOBALLY using AK::is_ascii; using AK::is_ascii_alpha; using AK::is_ascii_alphanumeric; @@ -199,3 +200,4 @@ using AK::parse_ascii_hex_digit; using AK::to_ascii_base36_digit; using AK::to_ascii_lowercase; using AK::to_ascii_uppercase; +#endif diff --git a/AK/Checked.h b/AK/Checked.h index 41f1c0b8cb2..a765b2d24d2 100644 --- a/AK/Checked.h +++ b/AK/Checked.h @@ -452,5 +452,7 @@ constexpr Checked make_checked(T value) } +#if USING_AK_GLOBALLY using AK::Checked; using AK::make_checked; +#endif diff --git a/AK/CircularDeque.h b/AK/CircularDeque.h index 7174ddcaf15..0a3d077d845 100644 --- a/AK/CircularDeque.h +++ b/AK/CircularDeque.h @@ -41,4 +41,6 @@ public: } +#if USING_AK_GLOBALLY using AK::CircularDeque; +#endif diff --git a/AK/CircularDuplexStream.h b/AK/CircularDuplexStream.h index 1819e6254f6..016bd2fd869 100644 --- a/AK/CircularDuplexStream.h +++ b/AK/CircularDuplexStream.h @@ -120,4 +120,6 @@ private: } +#if USING_AK_GLOBALLY using AK::CircularDuplexStream; +#endif diff --git a/AK/CircularQueue.h b/AK/CircularQueue.h index 979989aa2fd..856a9d6bd92 100644 --- a/AK/CircularQueue.h +++ b/AK/CircularQueue.h @@ -133,4 +133,6 @@ protected: } +#if USING_AK_GLOBALLY using AK::CircularQueue; +#endif diff --git a/AK/Complex.h b/AK/Complex.h index 4a21b9480e1..f2655314cc5 100644 --- a/AK/Complex.h +++ b/AK/Complex.h @@ -281,10 +281,12 @@ static constexpr Complex cexp(Complex const& a) } } +# if USING_AK_GLOBALLY using AK::approx_eq; using AK::cexp; using AK::Complex; using AK::complex_imag_unit; using AK::complex_real_unit; +# endif #endif diff --git a/AK/Concepts.h b/AK/Concepts.h index f54028929a6..aaa1348cc70 100644 --- a/AK/Concepts.h +++ b/AK/Concepts.h @@ -121,6 +121,7 @@ concept FallibleFunction = requires(Func&& func, Args&&... args) { // clang-format on } +#if USING_AK_GLOBALLY using AK::Concepts::Arithmetic; using AK::Concepts::ArrayLike; using AK::Concepts::Enum; @@ -138,3 +139,4 @@ using AK::Concepts::Signed; using AK::Concepts::SpecializationOf; using AK::Concepts::Unsigned; using AK::Concepts::VoidFunction; +#endif diff --git a/AK/DateConstants.h b/AK/DateConstants.h index e1de17e7640..939ac4aa85d 100644 --- a/AK/DateConstants.h +++ b/AK/DateConstants.h @@ -39,9 +39,11 @@ static constexpr Array short_month_names = { } +#if USING_AK_GLOBALLY using AK::long_day_names; using AK::long_month_names; using AK::micro_day_names; using AK::mini_day_names; using AK::short_day_names; using AK::short_month_names; +#endif diff --git a/AK/DateTimeLexer.h b/AK/DateTimeLexer.h index 98c81b78f64..5704f3785d6 100644 --- a/AK/DateTimeLexer.h +++ b/AK/DateTimeLexer.h @@ -143,4 +143,6 @@ public: } +#if USING_AK_GLOBALLY using AK::DateTimeLexer; +#endif diff --git a/AK/Demangle.h b/AK/Demangle.h index 14627670dcb..13554065688 100644 --- a/AK/Demangle.h +++ b/AK/Demangle.h @@ -26,6 +26,8 @@ inline String demangle(StringView name) } +# if USING_AK_GLOBALLY using AK::demangle; +# endif #endif diff --git a/AK/DisjointChunks.h b/AK/DisjointChunks.h index d07d3d8690f..e9c9da544df 100644 --- a/AK/DisjointChunks.h +++ b/AK/DisjointChunks.h @@ -436,5 +436,7 @@ private: } +#if USING_AK_GLOBALLY using AK::DisjointChunks; using AK::DisjointSpans; +#endif diff --git a/AK/DistinctNumeric.h b/AK/DistinctNumeric.h index 934d6ae4320..1e0525ae7e9 100644 --- a/AK/DistinctNumeric.h +++ b/AK/DistinctNumeric.h @@ -344,4 +344,6 @@ struct Traits> : public GenericTraits const& d) { return Traits::hash(d.value()); } }; +#if USING_AK_GLOBALLY using AK::DistinctNumeric; +#endif diff --git a/AK/DoublyLinkedList.h b/AK/DoublyLinkedList.h index bfdb9c6e821..9789fec8b59 100644 --- a/AK/DoublyLinkedList.h +++ b/AK/DoublyLinkedList.h @@ -201,4 +201,6 @@ private: } +#if USING_AK_GLOBALLY using AK::DoublyLinkedList; +#endif diff --git a/AK/Endian.h b/AK/Endian.h index dbddd3f713b..4bf778a3515 100644 --- a/AK/Endian.h +++ b/AK/Endian.h @@ -145,6 +145,8 @@ requires(HasFormatter) struct Formatter> : Formatter { } +#if USING_AK_GLOBALLY using AK::BigEndian; using AK::LittleEndian; using AK::NetworkOrdered; +#endif diff --git a/AK/Error.h b/AK/Error.h index 56265bf3c76..398066a3561 100644 --- a/AK/Error.h +++ b/AK/Error.h @@ -125,5 +125,7 @@ public: } +#if USING_AK_GLOBALLY using AK::Error; using AK::ErrorOr; +#endif diff --git a/AK/FileStream.h b/AK/FileStream.h index 3a555d084a1..355d5097ca2 100644 --- a/AK/FileStream.h +++ b/AK/FileStream.h @@ -168,7 +168,9 @@ private: } +# if USING_AK_GLOBALLY using AK::InputFileStream; using AK::OutputFileStream; +# endif #endif diff --git a/AK/FixedArray.h b/AK/FixedArray.h index 312d94f830b..fe3da718be3 100644 --- a/AK/FixedArray.h +++ b/AK/FixedArray.h @@ -181,4 +181,6 @@ private: } +#if USING_AK_GLOBALLY using AK::FixedArray; +#endif diff --git a/AK/FixedPoint.h b/AK/FixedPoint.h index 00ff9c34d69..69618e49728 100644 --- a/AK/FixedPoint.h +++ b/AK/FixedPoint.h @@ -389,4 +389,6 @@ private: } +#if USING_AK_GLOBALLY using AK::FixedPoint; +#endif diff --git a/AK/FloatingPoint.h b/AK/FloatingPoint.h index 02818e8757f..eeca5ea6b64 100644 --- a/AK/FloatingPoint.h +++ b/AK/FloatingPoint.h @@ -232,6 +232,7 @@ constexpr float convert_to_native_float(I input) { return float_to_float parse_first_hexfloat_until_zero_character(char cons } +#if USING_AK_GLOBALLY using AK::parse_first_floating_point; using AK::parse_first_hexfloat_until_zero_character; using AK::parse_floating_point_completely; +#endif diff --git a/AK/FlyString.h b/AK/FlyString.h index 7d174952d2c..03a3c58b077 100644 --- a/AK/FlyString.h +++ b/AK/FlyString.h @@ -101,4 +101,6 @@ struct Traits : public GenericTraits { } +#if USING_AK_GLOBALLY using AK::FlyString; +#endif diff --git a/AK/Format.h b/AK/Format.h index dcba9d81dd4..15cc184e163 100644 --- a/AK/Format.h +++ b/AK/Format.h @@ -698,16 +698,17 @@ struct Formatter> : Formatter { } // namespace AK -#ifdef KERNEL +#if USING_AK_GLOBALLY +# ifdef KERNEL using AK::critical_dmesgln; using AK::dmesgln; -#else +# else using AK::out; using AK::outln; using AK::warn; using AK::warnln; -#endif +# endif using AK::dbgln; @@ -715,8 +716,10 @@ using AK::CheckedFormatString; using AK::FormatIfSupported; using AK::FormatString; -#define dbgln_if(flag, fmt, ...) \ - do { \ - if constexpr (flag) \ - dbgln(fmt, ##__VA_ARGS__); \ - } while (0) +# define dbgln_if(flag, fmt, ...) \ + do { \ + if constexpr (flag) \ + dbgln(fmt, ##__VA_ARGS__); \ + } while (0) + +#endif diff --git a/AK/Forward.h b/AK/Forward.h index 558a8a80280..9a26dabb227 100644 --- a/AK/Forward.h +++ b/AK/Forward.h @@ -146,6 +146,7 @@ class [[nodiscard]] ErrorOr; } +#if USING_AK_GLOBALLY using AK::Array; using AK::Atomic; using AK::Badge; @@ -199,9 +200,11 @@ using AK::Utf8CodePointIterator; using AK::Utf8View; using AK::Vector; -#ifdef KERNEL +# ifdef KERNEL using AK::LockRefPtr; using AK::LockRefPtrTraits; using AK::NonnullLockRefPtr; using AK::NonnullLockRefPtrVector; +# endif + #endif diff --git a/AK/Function.h b/AK/Function.h index b0262e42aea..79a56eb4820 100644 --- a/AK/Function.h +++ b/AK/Function.h @@ -265,4 +265,6 @@ private: } +#if USING_AK_GLOBALLY using AK::Function; +#endif diff --git a/AK/FuzzyMatch.h b/AK/FuzzyMatch.h index 8480d6b6362..a8f4235dbc4 100644 --- a/AK/FuzzyMatch.h +++ b/AK/FuzzyMatch.h @@ -19,5 +19,7 @@ FuzzyMatchResult fuzzy_match(StringView needle, StringView haystack); } +#if USING_AK_GLOBALLY using AK::fuzzy_match; using AK::FuzzyMatchResult; +#endif diff --git a/AK/GenericLexer.h b/AK/GenericLexer.h index b7f2765c446..0ac347245e3 100644 --- a/AK/GenericLexer.h +++ b/AK/GenericLexer.h @@ -239,7 +239,9 @@ constexpr auto is_quote = is_any_of("'\""sv); } +#if USING_AK_GLOBALLY using AK::GenericLexer; using AK::is_any_of; using AK::is_path_separator; using AK::is_quote; +#endif diff --git a/AK/GenericShorthands.h b/AK/GenericShorthands.h index a39b57342a5..73941857dfb 100644 --- a/AK/GenericShorthands.h +++ b/AK/GenericShorthands.h @@ -6,6 +6,8 @@ #pragma once +#include + namespace AK { template @@ -63,6 +65,7 @@ template } } +#if USING_AK_GLOBALLY using AK::first_is_larger_or_equal_than_all_of; using AK::first_is_larger_or_equal_than_one_of; using AK::first_is_larger_than_all_of; @@ -72,3 +75,4 @@ using AK::first_is_smaller_or_equal_than_all_of; using AK::first_is_smaller_or_equal_than_one_of; using AK::first_is_smaller_than_all_of; using AK::first_is_smaller_than_one_of; +#endif diff --git a/AK/HashMap.h b/AK/HashMap.h index 4d61cede6ae..7ae9b26187c 100644 --- a/AK/HashMap.h +++ b/AK/HashMap.h @@ -243,5 +243,7 @@ private: } +#if USING_AK_GLOBALLY using AK::HashMap; using AK::OrderedHashMap; +#endif diff --git a/AK/HashTable.h b/AK/HashTable.h index b2d9b6fe087..65e7ac9e4ed 100644 --- a/AK/HashTable.h +++ b/AK/HashTable.h @@ -724,5 +724,8 @@ private: }; } +#if USING_AK_GLOBALLY +using AK::HashSetResult; using AK::HashTable; using AK::OrderedHashTable; +#endif diff --git a/AK/Hex.h b/AK/Hex.h index b421e9ac259..0c1661a6bc4 100644 --- a/AK/Hex.h +++ b/AK/Hex.h @@ -39,6 +39,8 @@ String encode_hex(ReadonlyBytes); } +#if USING_AK_GLOBALLY using AK::decode_hex; using AK::decode_hex_digit; using AK::encode_hex; +#endif diff --git a/AK/IDAllocator.h b/AK/IDAllocator.h index be5ba7c7632..91f2fda7a45 100644 --- a/AK/IDAllocator.h +++ b/AK/IDAllocator.h @@ -43,4 +43,6 @@ private: }; } +#if USING_AK_GLOBALLY using AK::IDAllocator; +#endif diff --git a/AK/IPv4Address.h b/AK/IPv4Address.h index d52996a9c9d..2bb0468009f 100644 --- a/AK/IPv4Address.h +++ b/AK/IPv4Address.h @@ -176,4 +176,6 @@ struct Formatter : Formatter { } +#if USING_AK_GLOBALLY using AK::IPv4Address; +#endif diff --git a/AK/IPv6Address.h b/AK/IPv6Address.h index 808c71a131d..148968e4ad9 100644 --- a/AK/IPv6Address.h +++ b/AK/IPv6Address.h @@ -299,4 +299,6 @@ struct Formatter : Formatter { } +#if USING_AK_GLOBALLY using AK::IPv6Address; +#endif diff --git a/AK/IntrusiveList.h b/AK/IntrusiveList.h index 0ce5f87746f..df822ccef05 100644 --- a/AK/IntrusiveList.h +++ b/AK/IntrusiveList.h @@ -461,5 +461,7 @@ using IntrusiveList = Detail::IntrusiveList< } +#if USING_AK_GLOBALLY using AK::IntrusiveList; using AK::IntrusiveListNode; +#endif diff --git a/AK/IntrusiveListRelaxedConst.h b/AK/IntrusiveListRelaxedConst.h index da94b1cc00a..7faef434e62 100644 --- a/AK/IntrusiveListRelaxedConst.h +++ b/AK/IntrusiveListRelaxedConst.h @@ -35,4 +35,6 @@ using IntrusiveListRelaxedConst = Detail::IntrusiveListRelaxedConst< } +#if USING_AK_GLOBALLY using AK::IntrusiveListRelaxedConst; +#endif diff --git a/AK/IntrusiveRedBlackTree.h b/AK/IntrusiveRedBlackTree.h index 763ff975e6e..097e479b595 100644 --- a/AK/IntrusiveRedBlackTree.h +++ b/AK/IntrusiveRedBlackTree.h @@ -235,5 +235,7 @@ using IntrusiveRedBlackTree = Detail::IntrusiveRedBlackTree< } +#if USING_AK_GLOBALLY using AK::IntrusiveRedBlackTree; using AK::IntrusiveRedBlackTreeNode; +#endif diff --git a/AK/IterationDecision.h b/AK/IterationDecision.h index e1629b139fa..825217e775c 100644 --- a/AK/IterationDecision.h +++ b/AK/IterationDecision.h @@ -6,6 +6,8 @@ #pragma once +#include + namespace AK { enum class IterationDecision { @@ -15,4 +17,6 @@ enum class IterationDecision { } +#if USING_AK_GLOBALLY using AK::IterationDecision; +#endif diff --git a/AK/JsonArray.h b/AK/JsonArray.h index 932f8b77ace..4a3b962bfa3 100644 --- a/AK/JsonArray.h +++ b/AK/JsonArray.h @@ -114,4 +114,6 @@ inline typename Builder::OutputType JsonArray::serialized() const } +#if USING_AK_GLOBALLY using AK::JsonArray; +#endif diff --git a/AK/JsonArraySerializer.h b/AK/JsonArraySerializer.h index 7d7f8dad8f8..e10d5d5e68b 100644 --- a/AK/JsonArraySerializer.h +++ b/AK/JsonArraySerializer.h @@ -225,4 +225,6 @@ struct JsonArraySerializer { } +#if USING_AK_GLOBALLY using AK::JsonArraySerializer; +#endif diff --git a/AK/JsonObject.h b/AK/JsonObject.h index b59000c93c1..df638343c12 100644 --- a/AK/JsonObject.h +++ b/AK/JsonObject.h @@ -243,4 +243,6 @@ inline typename Builder::OutputType JsonValue::serialized() const } +#if USING_AK_GLOBALLY using AK::JsonObject; +#endif diff --git a/AK/JsonObjectSerializer.h b/AK/JsonObjectSerializer.h index 036d67efe25..fe705c2d719 100644 --- a/AK/JsonObjectSerializer.h +++ b/AK/JsonObjectSerializer.h @@ -262,4 +262,6 @@ ErrorOr> JsonArraySerializer::add_object( } +#if USING_AK_GLOBALLY using AK::JsonObjectSerializer; +#endif diff --git a/AK/JsonParser.h b/AK/JsonParser.h index 6e04d0014cd..a8507cc2b08 100644 --- a/AK/JsonParser.h +++ b/AK/JsonParser.h @@ -35,4 +35,6 @@ private: } +#if USING_AK_GLOBALLY using AK::JsonParser; +#endif diff --git a/AK/JsonPath.h b/AK/JsonPath.h index c820213e4c9..e3ee801ceea 100644 --- a/AK/JsonPath.h +++ b/AK/JsonPath.h @@ -95,5 +95,7 @@ public: } +#if USING_AK_GLOBALLY using AK::JsonPath; using AK::JsonPathElement; +#endif diff --git a/AK/JsonValue.h b/AK/JsonValue.h index a1a8f65be52..46b6e652e23 100644 --- a/AK/JsonValue.h +++ b/AK/JsonValue.h @@ -290,4 +290,6 @@ struct Formatter : Formatter { } +#if USING_AK_GLOBALLY using AK::JsonValue; +#endif diff --git a/AK/LEB128.h b/AK/LEB128.h index ff5b46b6b98..47b29f584d1 100644 --- a/AK/LEB128.h +++ b/AK/LEB128.h @@ -114,4 +114,6 @@ struct LEB128 { } +#if USING_AK_GLOBALLY using AK::LEB128; +#endif diff --git a/AK/LexicalPath.h b/AK/LexicalPath.h index 0081133db89..5d2731e9308 100644 --- a/AK/LexicalPath.h +++ b/AK/LexicalPath.h @@ -95,4 +95,6 @@ struct Formatter : Formatter { }; +#if USING_AK_GLOBALLY using AK::LexicalPath; +#endif diff --git a/AK/Math.h b/AK/Math.h index 609e53d3fb7..247bafbe65d 100644 --- a/AK/Math.h +++ b/AK/Math.h @@ -775,4 +775,6 @@ constexpr T ceil(T num) #undef AARCH64_INSTRUCTION } +#if USING_AK_GLOBALLY using AK::round_to; +#endif diff --git a/AK/Memory.h b/AK/Memory.h index 83cad053086..8c79b745bd0 100644 --- a/AK/Memory.h +++ b/AK/Memory.h @@ -76,5 +76,7 @@ inline bool timing_safe_compare(void const* b1, void const* b2, size_t len) } +#if USING_AK_GLOBALLY using AK::secure_zero; using AK::timing_safe_compare; +#endif diff --git a/AK/MemoryStream.h b/AK/MemoryStream.h index c4fd384f0c4..0bada40b8e8 100644 --- a/AK/MemoryStream.h +++ b/AK/MemoryStream.h @@ -272,7 +272,9 @@ private: } +#if USING_AK_GLOBALLY using AK::DuplexMemoryStream; using AK::InputMemoryStream; using AK::InputStream; using AK::OutputMemoryStream; +#endif diff --git a/AK/NeverDestroyed.h b/AK/NeverDestroyed.h index df9ba2e4663..2014407d431 100644 --- a/AK/NeverDestroyed.h +++ b/AK/NeverDestroyed.h @@ -40,4 +40,6 @@ private: } +#if USING_AK_GLOBALLY using AK::NeverDestroyed; +#endif diff --git a/AK/NoAllocationGuard.h b/AK/NoAllocationGuard.h index 544057809b1..a809e68b690 100644 --- a/AK/NoAllocationGuard.h +++ b/AK/NoAllocationGuard.h @@ -63,4 +63,6 @@ private: } +#if USING_AK_GLOBALLY using AK::NoAllocationGuard; +#endif diff --git a/AK/NonnullOwnPtr.h b/AK/NonnullOwnPtr.h index 60d46401cef..d9b48b1c101 100644 --- a/AK/NonnullOwnPtr.h +++ b/AK/NonnullOwnPtr.h @@ -185,8 +185,10 @@ struct Formatter> : Formatter { } -#if !defined(KERNEL) +#if USING_AK_GLOBALLY +# if !defined(KERNEL) using AK::adopt_own; using AK::make; -#endif +# endif using AK::NonnullOwnPtr; +#endif diff --git a/AK/NonnullOwnPtrVector.h b/AK/NonnullOwnPtrVector.h index 9457e0aa863..d6116a6893f 100644 --- a/AK/NonnullOwnPtrVector.h +++ b/AK/NonnullOwnPtrVector.h @@ -17,4 +17,6 @@ class NonnullOwnPtrVector : public NonnullPtrVector, inline_cap } +#if USING_AK_GLOBALLY using AK::NonnullOwnPtrVector; +#endif diff --git a/AK/NonnullRefPtr.h b/AK/NonnullRefPtr.h index d829ef5c0f5..11d1a4aca74 100644 --- a/AK/NonnullRefPtr.h +++ b/AK/NonnullRefPtr.h @@ -256,6 +256,8 @@ struct Traits> : public GenericTraits> { static bool equals(NonnullRefPtr const& a, NonnullRefPtr const& b) { return a.ptr() == b.ptr(); } }; +#if USING_AK_GLOBALLY using AK::adopt_ref; using AK::make_ref_counted; using AK::NonnullRefPtr; +#endif diff --git a/AK/NonnullRefPtrVector.h b/AK/NonnullRefPtrVector.h index 0927d7d87a6..a012e2d58ec 100644 --- a/AK/NonnullRefPtrVector.h +++ b/AK/NonnullRefPtrVector.h @@ -18,4 +18,6 @@ class NonnullRefPtrVector : public NonnullPtrVector, inline_cap } +#if USING_AK_GLOBALLY using AK::NonnullRefPtrVector; +#endif diff --git a/AK/NumberFormat.h b/AK/NumberFormat.h index 610ad686f40..55dacc7c9f5 100644 --- a/AK/NumberFormat.h +++ b/AK/NumberFormat.h @@ -83,7 +83,9 @@ static inline String human_readable_digital_time(i64 time_in_seconds) } +#if USING_AK_GLOBALLY using AK::human_readable_digital_time; using AK::human_readable_size; using AK::human_readable_size_long; using AK::human_readable_time; +#endif diff --git a/AK/NumericLimits.h b/AK/NumericLimits.h index 69d5080d6a7..0adefc9e5a0 100644 --- a/AK/NumericLimits.h +++ b/AK/NumericLimits.h @@ -129,4 +129,6 @@ struct NumericLimits { } +#if USING_AK_GLOBALLY using AK::NumericLimits; +#endif diff --git a/AK/Optional.h b/AK/Optional.h index ac777e21c1f..eafb343bb9e 100644 --- a/AK/Optional.h +++ b/AK/Optional.h @@ -364,4 +364,6 @@ private: } +#if USING_AK_GLOBALLY using AK::Optional; +#endif diff --git a/AK/OwnPtr.h b/AK/OwnPtr.h index ec486ccc406..efab35a12b8 100644 --- a/AK/OwnPtr.h +++ b/AK/OwnPtr.h @@ -224,7 +224,9 @@ struct Traits> : public GenericTraits> { } +#if USING_AK_GLOBALLY using AK::adopt_nonnull_own_or_enomem; using AK::adopt_own_if_nonnull; using AK::OwnPtr; using AK::try_make; +#endif diff --git a/AK/Platform.h b/AK/Platform.h index 6bd00828978..a3def1f20ea 100644 --- a/AK/Platform.h +++ b/AK/Platform.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020, Andreas Kling + * Copyright (c) 2018-2022, Andreas Kling * Copyright (c) 2022, Nico Weber * * SPDX-License-Identifier: BSD-2-Clause @@ -7,6 +7,10 @@ #pragma once +#ifndef USING_AK_GLOBALLY +# define USING_AK_GLOBALLY 1 +#endif + #ifdef __i386__ # define AK_ARCH_I386 1 #endif diff --git a/AK/Ptr32.h b/AK/Ptr32.h index 9c7880123cc..0441feb5392 100644 --- a/AK/Ptr32.h +++ b/AK/Ptr32.h @@ -56,4 +56,6 @@ private: } +#if USING_AK_GLOBALLY using AK::Ptr32; +#endif diff --git a/AK/Queue.h b/AK/Queue.h index 448856a6653..c3c68051408 100644 --- a/AK/Queue.h +++ b/AK/Queue.h @@ -83,4 +83,6 @@ private: } +#if USING_AK_GLOBALLY using AK::Queue; +#endif diff --git a/AK/QuickSort.h b/AK/QuickSort.h index 27964915220..f5f3af060df 100644 --- a/AK/QuickSort.h +++ b/AK/QuickSort.h @@ -151,4 +151,6 @@ void quick_sort(Collection& collection) } +#if USING_AK_GLOBALLY using AK::quick_sort; +#endif diff --git a/AK/Random.h b/AK/Random.h index 65466680c69..aca1e2d2cba 100644 --- a/AK/Random.h +++ b/AK/Random.h @@ -55,6 +55,8 @@ u32 get_random_uniform(u32 max_bounds); } +#if USING_AK_GLOBALLY using AK::fill_with_random; using AK::get_random; using AK::get_random_uniform; +#endif diff --git a/AK/RecursionDecision.h b/AK/RecursionDecision.h index d2982767a2b..ea3c6020420 100644 --- a/AK/RecursionDecision.h +++ b/AK/RecursionDecision.h @@ -16,4 +16,6 @@ enum class RecursionDecision { } +#if USING_AK_GLOBALLY using AK::RecursionDecision; +#endif diff --git a/AK/RedBlackTree.h b/AK/RedBlackTree.h index 8106b70d99a..43d044ca58f 100644 --- a/AK/RedBlackTree.h +++ b/AK/RedBlackTree.h @@ -587,4 +587,6 @@ private: } +#if USING_AK_GLOBALLY using AK::RedBlackTree; +#endif diff --git a/AK/RefCountForwarder.h b/AK/RefCountForwarder.h index c52360747ff..65b63a1fdfd 100644 --- a/AK/RefCountForwarder.h +++ b/AK/RefCountForwarder.h @@ -29,4 +29,6 @@ private: } +#if USING_AK_GLOBALLY using AK::RefCountForwarder; +#endif diff --git a/AK/RefCounted.h b/AK/RefCounted.h index 13cb082391e..7f5eb5eb198 100644 --- a/AK/RefCounted.h +++ b/AK/RefCounted.h @@ -72,5 +72,7 @@ public: } +#if USING_AK_GLOBALLY using AK::RefCounted; using AK::RefCountedBase; +#endif diff --git a/AK/RefPtr.h b/AK/RefPtr.h index 8ca2346c4b4..a98fddd7f3e 100644 --- a/AK/RefPtr.h +++ b/AK/RefPtr.h @@ -340,7 +340,9 @@ inline ErrorOr> adopt_nonnull_ref_or_enomem(T* object) } +#if USING_AK_GLOBALLY using AK::adopt_ref_if_nonnull; using AK::RefPtr; using AK::static_ptr_cast; using AK::try_make_ref_counted; +#endif diff --git a/AK/Result.h b/AK/Result.h index c4ff023759f..9deaed96206 100644 --- a/AK/Result.h +++ b/AK/Result.h @@ -118,4 +118,6 @@ private: } +#if USING_AK_GLOBALLY using AK::Result; +#endif diff --git a/AK/ScopeGuard.h b/AK/ScopeGuard.h index cfa0ccae2b4..28972034657 100644 --- a/AK/ScopeGuard.h +++ b/AK/ScopeGuard.h @@ -50,5 +50,7 @@ private: } +#if USING_AK_GLOBALLY using AK::ArmedScopeGuard; using AK::ScopeGuard; +#endif diff --git a/AK/ScopeLogger.h b/AK/ScopeLogger.h index 7fabbd348a3..e6be2db10fc 100644 --- a/AK/ScopeLogger.h +++ b/AK/ScopeLogger.h @@ -62,4 +62,6 @@ public: } +#if USING_AK_GLOBALLY using AK::ScopeLogger; +#endif diff --git a/AK/ScopedValueRollback.h b/AK/ScopedValueRollback.h index 08f0148d217..156bc984218 100644 --- a/AK/ScopedValueRollback.h +++ b/AK/ScopedValueRollback.h @@ -34,4 +34,6 @@ private: } +#if USING_AK_GLOBALLY using AK::ScopedValueRollback; +#endif diff --git a/AK/Singleton.h b/AK/Singleton.h index 3365309d283..a4ade26609d 100644 --- a/AK/Singleton.h +++ b/AK/Singleton.h @@ -134,4 +134,6 @@ private: } +#if USING_AK_GLOBALLY using AK::Singleton; +#endif diff --git a/AK/SinglyLinkedList.h b/AK/SinglyLinkedList.h index 11a574495f9..151ff93c2d8 100644 --- a/AK/SinglyLinkedList.h +++ b/AK/SinglyLinkedList.h @@ -302,4 +302,6 @@ private: } +#if USING_AK_GLOBALLY using AK::SinglyLinkedList; +#endif diff --git a/AK/SinglyLinkedListWithCount.h b/AK/SinglyLinkedListWithCount.h index 39de6286100..04be949996c 100644 --- a/AK/SinglyLinkedListWithCount.h +++ b/AK/SinglyLinkedListWithCount.h @@ -139,4 +139,6 @@ private: } +#if USING_AK_GLOBALLY using AK::SinglyLinkedListWithCount; +#endif diff --git a/AK/SourceGenerator.h b/AK/SourceGenerator.h index 526c8ac4808..1d2cb278165 100644 --- a/AK/SourceGenerator.h +++ b/AK/SourceGenerator.h @@ -123,4 +123,6 @@ private: } +#if USING_AK_GLOBALLY using AK::SourceGenerator; +#endif diff --git a/AK/SourceLocation.h b/AK/SourceLocation.h index 21c7eff905d..a3a61b0a3d9 100644 --- a/AK/SourceLocation.h +++ b/AK/SourceLocation.h @@ -49,4 +49,6 @@ struct AK::Formatter : AK::Formatter { } }; +#if USING_AK_GLOBALLY using AK::SourceLocation; +#endif diff --git a/AK/Span.h b/AK/Span.h index 022757df13f..ab559ee9279 100644 --- a/AK/Span.h +++ b/AK/Span.h @@ -266,6 +266,8 @@ using Bytes = Span; } +#if USING_AK_GLOBALLY using AK::Bytes; using AK::ReadonlyBytes; using AK::Span; +#endif diff --git a/AK/Stack.h b/AK/Stack.h index 830387af232..4d177ce9d67 100644 --- a/AK/Stack.h +++ b/AK/Stack.h @@ -74,4 +74,6 @@ private: } +#if USING_AK_GLOBALLY using AK::Stack; +#endif diff --git a/AK/StackInfo.h b/AK/StackInfo.h index c58892c94ae..668bbd802f2 100644 --- a/AK/StackInfo.h +++ b/AK/StackInfo.h @@ -31,4 +31,6 @@ private: } +#if USING_AK_GLOBALLY using AK::StackInfo; +#endif diff --git a/AK/StdLibExtraDetails.h b/AK/StdLibExtraDetails.h index a970cfd2bb9..68689d8c83c 100644 --- a/AK/StdLibExtraDetails.h +++ b/AK/StdLibExtraDetails.h @@ -614,6 +614,8 @@ template inline constexpr bool IsOneOfIgnoringCV = (IsSameIgnoringCV || ...); } + +#if USING_AK_GLOBALLY using AK::Detail::AddConst; using AK::Detail::AddConstToReferencedType; using AK::Detail::AddLvalueReference; @@ -683,3 +685,4 @@ using AK::Detail::RemoveVolatile; using AK::Detail::TrueType; using AK::Detail::UnderlyingType; using AK::Detail::Void; +#endif diff --git a/AK/StdLibExtras.h b/AK/StdLibExtras.h index 19cdef35db1..aa3ec2484e0 100644 --- a/AK/StdLibExtras.h +++ b/AK/StdLibExtras.h @@ -178,6 +178,7 @@ __DEFINE_GENERIC_ABS(long double, 0.0L, fabsl); } +#if USING_AK_GLOBALLY using AK::array_size; using AK::ceil_div; using AK::clamp; @@ -189,3 +190,4 @@ using AK::mix; using AK::RawPtr; using AK::swap; using AK::to_underlying; +#endif diff --git a/AK/String.h b/AK/String.h index 22986e182f7..80017283088 100644 --- a/AK/String.h +++ b/AK/String.h @@ -335,6 +335,8 @@ InputStream& operator>>(InputStream& stream, String& string); } +#if USING_AK_GLOBALLY using AK::CaseInsensitiveStringTraits; using AK::escape_html_entities; using AK::String; +#endif diff --git a/AK/StringBuilder.h b/AK/StringBuilder.h index 1abf5cb9502..0d5d69e969c 100644 --- a/AK/StringBuilder.h +++ b/AK/StringBuilder.h @@ -96,4 +96,6 @@ private: } +#if USING_AK_GLOBALLY using AK::StringBuilder; +#endif diff --git a/AK/StringFloatingPointConversions.h b/AK/StringFloatingPointConversions.h index ff6a53c89b4..819743675a1 100644 --- a/AK/StringFloatingPointConversions.h +++ b/AK/StringFloatingPointConversions.h @@ -40,4 +40,6 @@ FloatingPointExponentialForm convert_floating_point_to_decimal_exponential_form( } +#if USING_AK_GLOBALLY using AK::convert_floating_point_to_decimal_exponential_form; +#endif diff --git a/AK/StringHash.h b/AK/StringHash.h index 6d5774af18d..396fefb1162 100644 --- a/AK/StringHash.h +++ b/AK/StringHash.h @@ -47,4 +47,6 @@ constexpr u32 case_insensitive_string_hash(char const* characters, size_t length } +#if USING_AK_GLOBALLY using AK::string_hash; +#endif diff --git a/AK/StringImpl.h b/AK/StringImpl.h index c89f0e1202d..85ad9d62aee 100644 --- a/AK/StringImpl.h +++ b/AK/StringImpl.h @@ -119,6 +119,8 @@ struct Formatter : Formatter { } +#if USING_AK_GLOBALLY using AK::Chomp; using AK::NoChomp; using AK::StringImpl; +#endif diff --git a/AK/StringUtils.h b/AK/StringUtils.h index d828a21efaf..8912e753ca5 100644 --- a/AK/StringUtils.h +++ b/AK/StringUtils.h @@ -109,8 +109,10 @@ size_t count(StringView, StringView needle); } +#if USING_AK_GLOBALLY using AK::CaseSensitivity; using AK::ReplaceMode; using AK::SplitBehavior; using AK::TrimMode; using AK::TrimWhitespace; +#endif diff --git a/AK/StringView.h b/AK/StringView.h index e73c1cddef9..3ae526ab505 100644 --- a/AK/StringView.h +++ b/AK/StringView.h @@ -357,5 +357,7 @@ struct CaseInsensitiveStringViewTraits : public Traits { return AK::StringView(cstring, length); } +#if USING_AK_GLOBALLY using AK::CaseInsensitiveStringViewTraits; using AK::StringView; +#endif diff --git a/AK/TemporaryChange.h b/AK/TemporaryChange.h index f585dbce390..1219b87d638 100644 --- a/AK/TemporaryChange.h +++ b/AK/TemporaryChange.h @@ -6,6 +6,8 @@ #pragma once +#include + namespace AK { template @@ -26,4 +28,6 @@ private: } +#if USING_AK_GLOBALLY using AK::TemporaryChange; +#endif diff --git a/AK/Time.h b/AK/Time.h index 8778ce3bcc1..9398a84a75c 100644 --- a/AK/Time.h +++ b/AK/Time.h @@ -353,6 +353,7 @@ inline bool operator!=(const T& a, const T& b) } +#if USING_AK_GLOBALLY using AK::day_of_week; using AK::day_of_year; using AK::days_in_month; @@ -375,3 +376,4 @@ using AK::operator>; using AK::operator>=; using AK::operator==; using AK::operator!=; +#endif diff --git a/AK/Traits.h b/AK/Traits.h index 133ff254621..3410424abaa 100644 --- a/AK/Traits.h +++ b/AK/Traits.h @@ -76,5 +76,7 @@ requires(Detail::IsPointerOfType) struct Traits : public GenericTrai } +#if USING_AK_GLOBALLY using AK::GenericTraits; using AK::Traits; +#endif diff --git a/AK/Trie.h b/AK/Trie.h index 50c2d556b03..f2b9f093618 100644 --- a/AK/Trie.h +++ b/AK/Trie.h @@ -273,4 +273,6 @@ public: } +#if USING_AK_GLOBALLY using AK::Trie; +#endif diff --git a/AK/Tuple.h b/AK/Tuple.h index ff628facff3..658b0863aba 100644 --- a/AK/Tuple.h +++ b/AK/Tuple.h @@ -220,4 +220,6 @@ Tuple(Args... args) -> Tuple; } +#if USING_AK_GLOBALLY using AK::Tuple; +#endif diff --git a/AK/TypeCasts.h b/AK/TypeCasts.h index e85dab1f08d..171d898d16a 100644 --- a/AK/TypeCasts.h +++ b/AK/TypeCasts.h @@ -45,5 +45,7 @@ ALWAYS_INLINE CopyConst& verify_cast(InputType& input) } +#if USING_AK_GLOBALLY using AK::is; using AK::verify_cast; +#endif diff --git a/AK/TypeList.h b/AK/TypeList.h index eb8377a9a99..2c28da3445d 100644 --- a/AK/TypeList.h +++ b/AK/TypeList.h @@ -66,8 +66,10 @@ constexpr void for_each_type_zipped(F&& f) } +#if USING_AK_GLOBALLY using AK::for_each_type; using AK::for_each_type_zipped; using AK::TypeList; using AK::TypeListElement; using AK::TypeWrapper; +#endif diff --git a/AK/URLParser.h b/AK/URLParser.h index 99e9dc0805c..b9886c16ed2 100644 --- a/AK/URLParser.h +++ b/AK/URLParser.h @@ -65,4 +65,6 @@ private: } +#if USING_AK_GLOBALLY using AK::URLParser; +#endif diff --git a/AK/UUID.h b/AK/UUID.h index bb3b5621116..924909ac7f2 100644 --- a/AK/UUID.h +++ b/AK/UUID.h @@ -49,4 +49,6 @@ private: } +#if USING_AK_GLOBALLY using AK::UUID; +#endif diff --git a/AK/Userspace.h b/AK/Userspace.h index f741df9b9c8..c22b051200a 100644 --- a/AK/Userspace.h +++ b/AK/Userspace.h @@ -74,5 +74,7 @@ inline Userspace static_ptr_cast(Userspace const& ptr) } +#if USING_AK_GLOBALLY using AK::static_ptr_cast; using AK::Userspace; +#endif diff --git a/AK/Utf16View.h b/AK/Utf16View.h index bd6b30a9307..2319fd77939 100644 --- a/AK/Utf16View.h +++ b/AK/Utf16View.h @@ -125,4 +125,6 @@ struct AK::Formatter : Formatter { } }; +#if USING_AK_GLOBALLY using AK::Utf16View; +#endif diff --git a/AK/Utf32View.h b/AK/Utf32View.h index 7cbaa1f6db5..9c116954c4d 100644 --- a/AK/Utf32View.h +++ b/AK/Utf32View.h @@ -121,4 +121,6 @@ private: } +#if USING_AK_GLOBALLY using AK::Utf32View; +#endif diff --git a/AK/Utf8View.h b/AK/Utf8View.h index 6c84ce42abe..aa6722b92cb 100644 --- a/AK/Utf8View.h +++ b/AK/Utf8View.h @@ -132,5 +132,7 @@ private: } +#if USING_AK_GLOBALLY using AK::Utf8CodePointIterator; using AK::Utf8View; +#endif diff --git a/AK/Variant.h b/AK/Variant.h index eb6500bc442..6cc3430cfd5 100644 --- a/AK/Variant.h +++ b/AK/Variant.h @@ -491,5 +491,7 @@ private: } +#if USING_AK_GLOBALLY using AK::Empty; using AK::Variant; +#endif diff --git a/AK/Vector.h b/AK/Vector.h index 1b4c4713fa5..8ccbaf3a1dc 100644 --- a/AK/Vector.h +++ b/AK/Vector.h @@ -828,4 +828,6 @@ Vector(Args... args) -> Vector>; } +#if USING_AK_GLOBALLY using AK::Vector; +#endif diff --git a/AK/WeakPtr.h b/AK/WeakPtr.h index caf881ce9e2..e7b02005d65 100644 --- a/AK/WeakPtr.h +++ b/AK/WeakPtr.h @@ -178,4 +178,6 @@ WeakPtr make_weak_ptr_if_nonnull(T const* ptr) } +#if USING_AK_GLOBALLY using AK::WeakPtr; +#endif diff --git a/AK/Weakable.h b/AK/Weakable.h index 1c90ba595b6..8a56dc90f25 100644 --- a/AK/Weakable.h +++ b/AK/Weakable.h @@ -87,4 +87,6 @@ private: } +#if USING_AK_GLOBALLY using AK::Weakable; +#endif