diff --git a/AK/Vector.h b/AK/Vector.h index 2ed2dc7bfc..1ae11d6cab 100644 --- a/AK/Vector.h +++ b/AK/Vector.h @@ -3,7 +3,13 @@ #include #include #include + +// NOTE: We can't include 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 +#endif #ifndef __serenity__ #include @@ -65,12 +71,14 @@ public: clear(); } +#ifndef SERENITY_LIBC_BUILD Vector(std::initializer_list list) { ensure_capacity(list.size()); for (auto& item : list) unchecked_append(item); } +#endif Vector(Vector&& other) : m_size(other.m_size) diff --git a/LibC/Makefile b/LibC/Makefile index 8892be807f..83b9e1944d 100644 --- a/LibC/Makefile +++ b/LibC/Makefile @@ -58,7 +58,7 @@ ASM_OBJS = setjmp.ao crti.ao crtn.ao CPP_OBJS = $(AK_OBJS) $(WIDGETS_OBJS) $(LIBC_OBJS) LIBRARY = libc.a -DEFINES += -DUSERLAND +DEFINES += -DUSERLAND -DSERENITY_LIBC_BUILD all: $(LIBRARY) startfiles