mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:07:45 +00:00
AK+LibC: Remove SERENITY_LIBC_BUILD guard around <initializer_list>
This was required before commit 5f724b6ca1
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.
This commit is contained in:
parent
210b0b883b
commit
da87497e61
3 changed files with 3 additions and 19 deletions
|
@ -9,13 +9,7 @@
|
||||||
#include <AK/HashTable.h>
|
#include <AK/HashTable.h>
|
||||||
#include <AK/Optional.h>
|
#include <AK/Optional.h>
|
||||||
#include <AK/Vector.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>
|
#include <initializer_list>
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace AK {
|
namespace AK {
|
||||||
|
|
||||||
|
@ -38,14 +32,12 @@ public:
|
||||||
|
|
||||||
HashMap() = default;
|
HashMap() = default;
|
||||||
|
|
||||||
#ifndef SERENITY_LIBC_BUILD
|
|
||||||
HashMap(std::initializer_list<Entry> list)
|
HashMap(std::initializer_list<Entry> list)
|
||||||
{
|
{
|
||||||
ensure_capacity(list.size());
|
ensure_capacity(list.size());
|
||||||
for (auto& item : list)
|
for (auto& item : list)
|
||||||
set(item.key, item.value);
|
set(item.key, item.value);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
[[nodiscard]] bool is_empty() const
|
[[nodiscard]] bool is_empty() const
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,13 +17,7 @@
|
||||||
#include <AK/Traits.h>
|
#include <AK/Traits.h>
|
||||||
#include <AK/TypedTransfer.h>
|
#include <AK/TypedTransfer.h>
|
||||||
#include <AK/kmalloc.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>
|
#include <initializer_list>
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __serenity__
|
#ifndef __serenity__
|
||||||
# include <new>
|
# include <new>
|
||||||
|
@ -65,14 +59,12 @@ public:
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef SERENITY_LIBC_BUILD
|
|
||||||
Vector(std::initializer_list<T> list) requires(!IsLvalueReference<T>)
|
Vector(std::initializer_list<T> list) requires(!IsLvalueReference<T>)
|
||||||
{
|
{
|
||||||
ensure_capacity(list.size());
|
ensure_capacity(list.size());
|
||||||
for (auto& item : list)
|
for (auto& item : list)
|
||||||
unchecked_append(item);
|
unchecked_append(item);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
Vector(Vector&& other)
|
Vector(Vector&& other)
|
||||||
: m_size(other.m_size)
|
: m_size(other.m_size)
|
||||||
|
|
|
@ -85,7 +85,7 @@ elseif ("${SERENITY_ARCH}" STREQUAL "x86_64")
|
||||||
set(CRTN_SOURCE "arch/x86_64/crtn.S")
|
set(CRTN_SOURCE "arch/x86_64/crtn.S")
|
||||||
endif()
|
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_library(crt0 STATIC crt0.cpp)
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue