summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Kaster <akaster@serenityos.org>2021-09-19 16:25:22 -0600
committerBrian Gianforcaro <b.gianfo@gmail.com>2021-09-20 00:39:46 +0000
commitda87497e61a8070250b45ae7622cdc998c34202e (patch)
treee54f7f850198130b63e33900d4a3d64f519f897c
parent210b0b883bbc8b660d46cc783f877cbaa5b93df0 (diff)
downloadserenity-da87497e61a8070250b45ae7622cdc998c34202e.zip
AK+LibC: Remove SERENITY_LIBC_BUILD guard around `<initializer_list>`
This was required before commit 5f724b6ca1aae3a5a8c7189069649e8a9347cca2 when we were building LibC before libstdc++ headers were available in the sysroot. However as noted in that commit, we never actually needed to be building LibC before libstdc++, so we can go ahead and remove this ancient hack.
-rw-r--r--AK/HashMap.h10
-rw-r--r--AK/Vector.h10
-rw-r--r--Userland/Libraries/LibC/CMakeLists.txt2
3 files changed, 3 insertions, 19 deletions
diff --git a/AK/HashMap.h b/AK/HashMap.h
index 4d4cdc516a..9c9b9d972a 100644
--- a/AK/HashMap.h
+++ b/AK/HashMap.h
@@ -9,13 +9,7 @@
#include <AK/HashTable.h>
#include <AK/Optional.h>
#include <AK/Vector.h>
-
-// NOTE: We can't include <initializer_list> during the toolchain bootstrap,
-// since it's part of libstdc++, and libstdc++ depends on LibC.
-// For this reason, we don't support HashMap(initializer_list) in LibC.
-#ifndef SERENITY_LIBC_BUILD
-# include <initializer_list>
-#endif
+#include <initializer_list>
namespace AK {
@@ -38,14 +32,12 @@ public:
HashMap() = default;
-#ifndef SERENITY_LIBC_BUILD
HashMap(std::initializer_list<Entry> list)
{
ensure_capacity(list.size());
for (auto& item : list)
set(item.key, item.value);
}
-#endif
[[nodiscard]] bool is_empty() const
{
diff --git a/AK/Vector.h b/AK/Vector.h
index 743d7b6a88..33908c81fa 100644
--- a/AK/Vector.h
+++ b/AK/Vector.h
@@ -17,13 +17,7 @@
#include <AK/Traits.h>
#include <AK/TypedTransfer.h>
#include <AK/kmalloc.h>
-
-// NOTE: We can't include <initializer_list> during the toolchain bootstrap,
-// since it's part of libstdc++, and libstdc++ depends on LibC.
-// For this reason, we don't support Vector(initializer_list) in LibC.
-#ifndef SERENITY_LIBC_BUILD
-# include <initializer_list>
-#endif
+#include <initializer_list>
#ifndef __serenity__
# include <new>
@@ -65,14 +59,12 @@ public:
{
}
-#ifndef SERENITY_LIBC_BUILD
Vector(std::initializer_list<T> list) requires(!IsLvalueReference<T>)
{
ensure_capacity(list.size());
for (auto& item : list)
unchecked_append(item);
}
-#endif
Vector(Vector&& other)
: m_size(other.m_size)
diff --git a/Userland/Libraries/LibC/CMakeLists.txt b/Userland/Libraries/LibC/CMakeLists.txt
index 98b31ba227..aab4d8aa9b 100644
--- a/Userland/Libraries/LibC/CMakeLists.txt
+++ b/Userland/Libraries/LibC/CMakeLists.txt
@@ -85,7 +85,7 @@ elseif ("${SERENITY_ARCH}" STREQUAL "x86_64")
set(CRTN_SOURCE "arch/x86_64/crtn.S")
endif()
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-warning-option -DSERENITY_LIBC_BUILD")
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-warning-option")
add_library(crt0 STATIC crt0.cpp)
add_custom_command(