mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-24 16:40:21 +00:00
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.
This commit is contained in:
parent
e50a43652e
commit
ae3ffdd521
Notes:
sideshowbarker
2024-07-17 04:01:30 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/ae3ffdd521 Pull-request: https://github.com/SerenityOS/serenity/pull/16206
124 changed files with 276 additions and 12 deletions
|
@ -32,4 +32,6 @@ template<IterableContainer Container>
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::all_of;
|
||||
#endif
|
||||
|
|
|
@ -29,4 +29,6 @@ template<IterableContainer Container>
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::any_of;
|
||||
#endif
|
||||
|
|
|
@ -123,4 +123,6 @@ struct ArbitrarySizedEnum : public T {
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::ArbitrarySizedEnum;
|
||||
#endif
|
||||
|
|
|
@ -111,5 +111,7 @@ constexpr static auto iota_array(T const offset = {})
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::Array;
|
||||
using AK::iota_array;
|
||||
#endif
|
||||
|
|
|
@ -442,5 +442,7 @@ public:
|
|||
};
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::Atomic;
|
||||
using AK::full_memory_barrier;
|
||||
#endif
|
||||
|
|
|
@ -83,5 +83,7 @@ public:
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::AtomicRefCounted;
|
||||
using AK::AtomicRefCountedBase;
|
||||
#endif
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Platform.h>
|
||||
|
||||
namespace AK {
|
||||
|
||||
template<typename T>
|
||||
|
@ -26,4 +28,6 @@ private:
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::Badge;
|
||||
#endif
|
||||
|
|
|
@ -22,5 +22,7 @@ namespace AK {
|
|||
[[nodiscard]] String encode_base64(ReadonlyBytes);
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::decode_base64;
|
||||
using AK::encode_base64;
|
||||
#endif
|
||||
|
|
|
@ -108,4 +108,6 @@ private:
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::BinaryHeap;
|
||||
#endif
|
||||
|
|
|
@ -67,4 +67,6 @@ constexpr auto binary_search(
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::binary_search;
|
||||
#endif
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Platform.h>
|
||||
|
||||
namespace AK {
|
||||
|
||||
template<typename T, typename U>
|
||||
|
@ -24,4 +26,6 @@ template<typename T, typename U>
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::bit_cast;
|
||||
#endif
|
||||
|
|
|
@ -239,5 +239,7 @@ private:
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::InputBitStream;
|
||||
using AK::OutputBitStream;
|
||||
#endif
|
||||
|
|
|
@ -191,4 +191,6 @@ private:
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::Bitmap;
|
||||
#endif
|
||||
|
|
|
@ -369,4 +369,6 @@ protected:
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::BitmapView;
|
||||
#endif
|
||||
|
|
|
@ -194,4 +194,6 @@ private:
|
|||
};
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::Buffered;
|
||||
#endif
|
||||
|
|
|
@ -197,5 +197,7 @@ inline Atomic<FlatPtr> BumpAllocator<use_mmap, size>::s_unused_allocation_cache
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::BumpAllocator;
|
||||
using AK::UniformBumpAllocator;
|
||||
#endif
|
||||
|
|
|
@ -55,4 +55,6 @@ struct ByteReader {
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::ByteReader;
|
||||
#endif
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -452,5 +452,7 @@ constexpr Checked<T> make_checked(T value)
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::Checked;
|
||||
using AK::make_checked;
|
||||
#endif
|
||||
|
|
|
@ -41,4 +41,6 @@ public:
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::CircularDeque;
|
||||
#endif
|
||||
|
|
|
@ -120,4 +120,6 @@ private:
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::CircularDuplexStream;
|
||||
#endif
|
||||
|
|
|
@ -133,4 +133,6 @@ protected:
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::CircularQueue;
|
||||
#endif
|
||||
|
|
|
@ -281,10 +281,12 @@ static constexpr Complex<T> cexp(Complex<T> 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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -39,9 +39,11 @@ static constexpr Array<StringView, 12> 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
|
||||
|
|
|
@ -143,4 +143,6 @@ public:
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::DateTimeLexer;
|
||||
#endif
|
||||
|
|
|
@ -26,6 +26,8 @@ inline String demangle(StringView name)
|
|||
|
||||
}
|
||||
|
||||
# if USING_AK_GLOBALLY
|
||||
using AK::demangle;
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -436,5 +436,7 @@ private:
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::DisjointChunks;
|
||||
using AK::DisjointSpans;
|
||||
#endif
|
||||
|
|
|
@ -344,4 +344,6 @@ struct Traits<AK::DistinctNumeric<T, X, Opts...>> : public GenericTraits<AK::Dis
|
|||
static constexpr auto hash(DistinctNumeric<T, X, Opts...> const& d) { return Traits<T>::hash(d.value()); }
|
||||
};
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::DistinctNumeric;
|
||||
#endif
|
||||
|
|
|
@ -201,4 +201,6 @@ private:
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::DoublyLinkedList;
|
||||
#endif
|
||||
|
|
|
@ -145,6 +145,8 @@ requires(HasFormatter<T>) struct Formatter<BigEndian<T>> : Formatter<T> {
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::BigEndian;
|
||||
using AK::LittleEndian;
|
||||
using AK::NetworkOrdered;
|
||||
#endif
|
||||
|
|
|
@ -125,5 +125,7 @@ public:
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::Error;
|
||||
using AK::ErrorOr;
|
||||
#endif
|
||||
|
|
|
@ -168,7 +168,9 @@ private:
|
|||
|
||||
}
|
||||
|
||||
# if USING_AK_GLOBALLY
|
||||
using AK::InputFileStream;
|
||||
using AK::OutputFileStream;
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -181,4 +181,6 @@ private:
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::FixedArray;
|
||||
#endif
|
||||
|
|
|
@ -389,4 +389,6 @@ private:
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::FixedPoint;
|
||||
#endif
|
||||
|
|
|
@ -232,6 +232,7 @@ constexpr float convert_to_native_float(I input) { return float_to_float<SingleF
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::DoubleFloatingPointBits;
|
||||
using AK::FloatExtractor;
|
||||
using AK::FloatingPointBits;
|
||||
|
@ -242,3 +243,4 @@ using AK::convert_from_native_float;
|
|||
using AK::convert_to_native_double;
|
||||
using AK::convert_to_native_float;
|
||||
using AK::float_to_float;
|
||||
#endif
|
||||
|
|
|
@ -80,6 +80,8 @@ FloatingPointParseResults<T> 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
|
||||
|
|
|
@ -101,4 +101,6 @@ struct Traits<FlyString> : public GenericTraits<FlyString> {
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::FlyString;
|
||||
#endif
|
||||
|
|
11
AK/Format.h
11
AK/Format.h
|
@ -698,16 +698,17 @@ struct Formatter<ErrorOr<T, ErrorType>> : Formatter<FormatString> {
|
|||
|
||||
} // 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, ...) \
|
||||
# define dbgln_if(flag, fmt, ...) \
|
||||
do { \
|
||||
if constexpr (flag) \
|
||||
dbgln(fmt, ##__VA_ARGS__); \
|
||||
} while (0)
|
||||
|
||||
#endif
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -265,4 +265,6 @@ private:
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::Function;
|
||||
#endif
|
||||
|
|
|
@ -19,5 +19,7 @@ FuzzyMatchResult fuzzy_match(StringView needle, StringView haystack);
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::fuzzy_match;
|
||||
using AK::FuzzyMatchResult;
|
||||
#endif
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Platform.h>
|
||||
|
||||
namespace AK {
|
||||
|
||||
template<typename T, typename... Ts>
|
||||
|
@ -63,6 +65,7 @@ template<typename T, typename... Ts>
|
|||
}
|
||||
}
|
||||
|
||||
#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
|
||||
|
|
|
@ -243,5 +243,7 @@ private:
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::HashMap;
|
||||
using AK::OrderedHashMap;
|
||||
#endif
|
||||
|
|
|
@ -724,5 +724,8 @@ private:
|
|||
};
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::HashSetResult;
|
||||
using AK::HashTable;
|
||||
using AK::OrderedHashTable;
|
||||
#endif
|
||||
|
|
2
AK/Hex.h
2
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
|
||||
|
|
|
@ -43,4 +43,6 @@ private:
|
|||
};
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::IDAllocator;
|
||||
#endif
|
||||
|
|
|
@ -176,4 +176,6 @@ struct Formatter<IPv4Address> : Formatter<String> {
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::IPv4Address;
|
||||
#endif
|
||||
|
|
|
@ -299,4 +299,6 @@ struct Formatter<IPv6Address> : Formatter<String> {
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::IPv6Address;
|
||||
#endif
|
||||
|
|
|
@ -461,5 +461,7 @@ using IntrusiveList = Detail::IntrusiveList<
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::IntrusiveList;
|
||||
using AK::IntrusiveListNode;
|
||||
#endif
|
||||
|
|
|
@ -35,4 +35,6 @@ using IntrusiveListRelaxedConst = Detail::IntrusiveListRelaxedConst<
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::IntrusiveListRelaxedConst;
|
||||
#endif
|
||||
|
|
|
@ -235,5 +235,7 @@ using IntrusiveRedBlackTree = Detail::IntrusiveRedBlackTree<
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::IntrusiveRedBlackTree;
|
||||
using AK::IntrusiveRedBlackTreeNode;
|
||||
#endif
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Platform.h>
|
||||
|
||||
namespace AK {
|
||||
|
||||
enum class IterationDecision {
|
||||
|
@ -15,4 +17,6 @@ enum class IterationDecision {
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::IterationDecision;
|
||||
#endif
|
||||
|
|
|
@ -114,4 +114,6 @@ inline typename Builder::OutputType JsonArray::serialized() const
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::JsonArray;
|
||||
#endif
|
||||
|
|
|
@ -225,4 +225,6 @@ struct JsonArraySerializer<void> {
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::JsonArraySerializer;
|
||||
#endif
|
||||
|
|
|
@ -243,4 +243,6 @@ inline typename Builder::OutputType JsonValue::serialized() const
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::JsonObject;
|
||||
#endif
|
||||
|
|
|
@ -262,4 +262,6 @@ ErrorOr<JsonObjectSerializer<Builder>> JsonArraySerializer<Builder>::add_object(
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::JsonObjectSerializer;
|
||||
#endif
|
||||
|
|
|
@ -35,4 +35,6 @@ private:
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::JsonParser;
|
||||
#endif
|
||||
|
|
|
@ -95,5 +95,7 @@ public:
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::JsonPath;
|
||||
using AK::JsonPathElement;
|
||||
#endif
|
||||
|
|
|
@ -290,4 +290,6 @@ struct Formatter<JsonValue> : Formatter<StringView> {
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::JsonValue;
|
||||
#endif
|
||||
|
|
|
@ -114,4 +114,6 @@ struct LEB128 {
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::LEB128;
|
||||
#endif
|
||||
|
|
|
@ -95,4 +95,6 @@ struct Formatter<LexicalPath> : Formatter<StringView> {
|
|||
|
||||
};
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::LexicalPath;
|
||||
#endif
|
||||
|
|
|
@ -775,4 +775,6 @@ constexpr T ceil(T num)
|
|||
#undef AARCH64_INSTRUCTION
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::round_to;
|
||||
#endif
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -272,7 +272,9 @@ private:
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::DuplexMemoryStream;
|
||||
using AK::InputMemoryStream;
|
||||
using AK::InputStream;
|
||||
using AK::OutputMemoryStream;
|
||||
#endif
|
||||
|
|
|
@ -40,4 +40,6 @@ private:
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::NeverDestroyed;
|
||||
#endif
|
||||
|
|
|
@ -63,4 +63,6 @@ private:
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::NoAllocationGuard;
|
||||
#endif
|
||||
|
|
|
@ -185,8 +185,10 @@ struct Formatter<NonnullOwnPtr<T>> : Formatter<const T*> {
|
|||
|
||||
}
|
||||
|
||||
#if !defined(KERNEL)
|
||||
#if USING_AK_GLOBALLY
|
||||
# if !defined(KERNEL)
|
||||
using AK::adopt_own;
|
||||
using AK::make;
|
||||
#endif
|
||||
# endif
|
||||
using AK::NonnullOwnPtr;
|
||||
#endif
|
||||
|
|
|
@ -17,4 +17,6 @@ class NonnullOwnPtrVector : public NonnullPtrVector<NonnullOwnPtr<T>, inline_cap
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::NonnullOwnPtrVector;
|
||||
#endif
|
||||
|
|
|
@ -256,6 +256,8 @@ struct Traits<NonnullRefPtr<T>> : public GenericTraits<NonnullRefPtr<T>> {
|
|||
static bool equals(NonnullRefPtr<T> const& a, NonnullRefPtr<T> const& b) { return a.ptr() == b.ptr(); }
|
||||
};
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::adopt_ref;
|
||||
using AK::make_ref_counted;
|
||||
using AK::NonnullRefPtr;
|
||||
#endif
|
||||
|
|
|
@ -18,4 +18,6 @@ class NonnullRefPtrVector : public NonnullPtrVector<NonnullRefPtr<T>, inline_cap
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::NonnullRefPtrVector;
|
||||
#endif
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -129,4 +129,6 @@ struct NumericLimits<long double> {
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::NumericLimits;
|
||||
#endif
|
||||
|
|
|
@ -364,4 +364,6 @@ private:
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::Optional;
|
||||
#endif
|
||||
|
|
|
@ -224,7 +224,9 @@ struct Traits<OwnPtr<T>> : public GenericTraits<OwnPtr<T>> {
|
|||
|
||||
}
|
||||
|
||||
#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
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2018-2022, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2022, Nico Weber <thakis@chromium.org>
|
||||
*
|
||||
* 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
|
||||
|
|
|
@ -56,4 +56,6 @@ private:
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::Ptr32;
|
||||
#endif
|
||||
|
|
|
@ -83,4 +83,6 @@ private:
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::Queue;
|
||||
#endif
|
||||
|
|
|
@ -151,4 +151,6 @@ void quick_sort(Collection& collection)
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::quick_sort;
|
||||
#endif
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -16,4 +16,6 @@ enum class RecursionDecision {
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::RecursionDecision;
|
||||
#endif
|
||||
|
|
|
@ -587,4 +587,6 @@ private:
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::RedBlackTree;
|
||||
#endif
|
||||
|
|
|
@ -29,4 +29,6 @@ private:
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::RefCountForwarder;
|
||||
#endif
|
||||
|
|
|
@ -72,5 +72,7 @@ public:
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::RefCounted;
|
||||
using AK::RefCountedBase;
|
||||
#endif
|
||||
|
|
|
@ -340,7 +340,9 @@ inline ErrorOr<NonnullRefPtr<T>> 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
|
||||
|
|
|
@ -118,4 +118,6 @@ private:
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::Result;
|
||||
#endif
|
||||
|
|
|
@ -50,5 +50,7 @@ private:
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::ArmedScopeGuard;
|
||||
using AK::ScopeGuard;
|
||||
#endif
|
||||
|
|
|
@ -62,4 +62,6 @@ public:
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::ScopeLogger;
|
||||
#endif
|
||||
|
|
|
@ -34,4 +34,6 @@ private:
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::ScopedValueRollback;
|
||||
#endif
|
||||
|
|
|
@ -134,4 +134,6 @@ private:
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::Singleton;
|
||||
#endif
|
||||
|
|
|
@ -302,4 +302,6 @@ private:
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::SinglyLinkedList;
|
||||
#endif
|
||||
|
|
|
@ -139,4 +139,6 @@ private:
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::SinglyLinkedListWithCount;
|
||||
#endif
|
||||
|
|
|
@ -123,4 +123,6 @@ private:
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::SourceGenerator;
|
||||
#endif
|
||||
|
|
|
@ -49,4 +49,6 @@ struct AK::Formatter<AK::SourceLocation> : AK::Formatter<FormatString> {
|
|||
}
|
||||
};
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::SourceLocation;
|
||||
#endif
|
||||
|
|
|
@ -266,6 +266,8 @@ using Bytes = Span<u8>;
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::Bytes;
|
||||
using AK::ReadonlyBytes;
|
||||
using AK::Span;
|
||||
#endif
|
||||
|
|
|
@ -74,4 +74,6 @@ private:
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::Stack;
|
||||
#endif
|
||||
|
|
|
@ -31,4 +31,6 @@ private:
|
|||
|
||||
}
|
||||
|
||||
#if USING_AK_GLOBALLY
|
||||
using AK::StackInfo;
|
||||
#endif
|
||||
|
|
|
@ -614,6 +614,8 @@ template<typename T, typename... Ts>
|
|||
inline constexpr bool IsOneOfIgnoringCV = (IsSameIgnoringCV<T, Ts> || ...);
|
||||
|
||||
}
|
||||
|
||||
#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
|
||||
|
|
|
@ -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
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue