From 156ab8750056c3ff440af0937806d8cdb2623816 Mon Sep 17 00:00:00 2001 From: Alex Rønne Petersen Date: Wed, 5 Feb 2025 10:50:09 +0100 Subject: libcxx: Update to Clang 20. See: * https://discourse.llvm.org/t/rfc-freezing-c-03-headers-in-libc/77319 * https://discourse.llvm.org/t/rfc-project-hand-in-hand-llvm-libc-libc-code-sharing/77701 We're dropping support for C++03 for Zig due to the first change; it would be insane to ship 1018 duplicate header files just for this outdated use case. As a result of the second change, I had to bring in a subset of the headers from llvm-libc since libc++ now depends on these. Hopefully we can continue to get away with not copying the entirety of llvm-libc. --- lib/libcxx/include/codecvt | 64 ++++++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 30 deletions(-) (limited to 'lib/libcxx/include/codecvt') diff --git a/lib/libcxx/include/codecvt b/lib/libcxx/include/codecvt index 65cd752d69..f7ae804c67 100644 --- a/lib/libcxx/include/codecvt +++ b/lib/libcxx/include/codecvt @@ -54,15 +54,18 @@ class codecvt_utf8_utf16 */ -#include <__config> -#include <__locale> -#include +#if __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS) +# include <__cxx03/codecvt> +#else +# include <__config> +# include <__locale> +# include -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -# pragma GCC system_header -#endif +# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +# pragma GCC system_header +# endif -#if _LIBCPP_STD_VER < 26 || defined(_LIBCPP_BUILDING_LIBRARY) || defined(_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT) +# if _LIBCPP_STD_VER < 26 || defined(_LIBCPP_BUILDING_LIBRARY) || defined(_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT) _LIBCPP_BEGIN_NAMESPACE_STD @@ -73,7 +76,7 @@ enum _LIBCPP_DEPRECATED_IN_CXX17 codecvt_mode { consume_header = 4, generate_hea template class __codecvt_utf8; -# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +# if _LIBCPP_HAS_WIDE_CHARACTERS template <> class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf8 : public codecvt { unsigned long __maxcode_; @@ -112,7 +115,7 @@ protected: int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override; int do_max_length() const _NOEXCEPT override; }; -# endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS +# endif // _LIBCPP_HAS_WIDE_CHARACTERS _LIBCPP_SUPPRESS_DEPRECATED_PUSH template <> @@ -203,7 +206,7 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP template class __codecvt_utf16; -# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +# if _LIBCPP_HAS_WIDE_CHARACTERS template <> class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf16 : public codecvt { unsigned long __maxcode_; @@ -281,7 +284,7 @@ protected: int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override; int do_max_length() const _NOEXCEPT override; }; -# endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS +# endif // _LIBCPP_HAS_WIDE_CHARACTERS _LIBCPP_SUPPRESS_DEPRECATED_PUSH template <> @@ -448,7 +451,7 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP template class __codecvt_utf8_utf16; -# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS +# if _LIBCPP_HAS_WIDE_CHARACTERS template <> class _LIBCPP_EXPORTED_FROM_ABI __codecvt_utf8_utf16 : public codecvt { unsigned long __maxcode_; @@ -487,7 +490,7 @@ protected: int do_length(state_type&, const extern_type* __frm, const extern_type* __end, size_t __mx) const override; int do_max_length() const _NOEXCEPT override; }; -# endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS +# endif // _LIBCPP_HAS_WIDE_CHARACTERS _LIBCPP_SUPPRESS_DEPRECATED_PUSH template <> @@ -576,22 +579,23 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP _LIBCPP_END_NAMESPACE_STD -#endif // _LIBCPP_STD_VER < 26 || defined(_LIBCPP_BUILDING_LIBRARY) || defined(_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT) - -#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -# include -#endif +# endif // _LIBCPP_STD_VER < 26 || defined(_LIBCPP_BUILDING_LIBRARY) || defined(_LIBCPP_ENABLE_CXX26_REMOVED_CODECVT) + +# if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20 +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# endif +#endif // __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS) #endif // _LIBCPP_CODECVT -- cgit v1.2.3