diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt --- a/libcxx/include/CMakeLists.txt +++ b/libcxx/include/CMakeLists.txt @@ -665,6 +665,7 @@ __support/musl/xlocale.h __support/newlib/xlocale.h __support/openbsd/xlocale.h + __support/serenity/xlocale.h __support/win32/locale_win32.h __support/xlocale/__nop_locale_mgmt.h __support/xlocale/__posix_l_fallback.h diff --git a/libcxx/include/__config b/libcxx/include/__config --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -956,7 +956,8 @@ defined(__APPLE__) || \ defined(__MVS__) || \ defined(_AIX) || \ - defined(__EMSCRIPTEN__) + defined(__EMSCRIPTEN__) || \ + defined(__serenity__) // clang-format on # define _LIBCPP_HAS_THREAD_API_PTHREAD # elif defined(__Fuchsia__) @@ -1034,7 +1035,7 @@ # endif # if defined(__BIONIC__) || defined(__NuttX__) || defined(__Fuchsia__) || defined(__wasi__) || \ - defined(_LIBCPP_HAS_MUSL_LIBC) || defined(__OpenBSD__) + defined(_LIBCPP_HAS_MUSL_LIBC) || defined(__OpenBSD__) || defined(__serenity__) # define _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE # endif diff --git a/libcxx/include/__locale b/libcxx/include/__locale --- a/libcxx/include/__locale +++ b/libcxx/include/__locale @@ -50,6 +50,8 @@ # include <__support/musl/xlocale.h> #elif defined(_LIBCPP_HAS_MUSL_LIBC) # include <__support/musl/xlocale.h> +#elif defined(__serenity__) +# include <__support/serenity/xlocale.h> #endif #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) diff --git a/libcxx/include/__support/serenity/xlocale.h b/libcxx/include/__support/serenity/xlocale.h new file mode 100644 --- /dev/null +++ b/libcxx/include/__support/serenity/xlocale.h @@ -0,0 +1,24 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#ifndef _LIBCPP_SUPPORT_SERENITY_XLOCALE_H +#define _LIBCPP_SUPPORT_SERENITY_XLOCALE_H + +#if defined(__serenity__) + +# include <__support/xlocale/__nop_locale_mgmt.h> +# include <__support/xlocale/__posix_l_fallback.h> +# include <__support/xlocale/__strtonum_fallback.h> +# include +# include +# include +# include + +#endif // __serenity__ + +#endif diff --git a/libcxx/include/locale b/libcxx/include/locale --- a/libcxx/include/locale +++ b/libcxx/include/locale @@ -217,7 +217,7 @@ #if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) // Most unix variants have catopen. These are the specific ones that don't. -# if !defined(__BIONIC__) && !defined(_NEWLIB_VERSION) && !defined(__EMSCRIPTEN__) +# if !defined(__BIONIC__) && !defined(_NEWLIB_VERSION) && !defined(__EMSCRIPTEN__) && !defined(__serenity__) # define _LIBCPP_HAS_CATOPEN 1 # include # endif diff --git a/libcxx/src/include/config_elast.h b/libcxx/src/include/config_elast.h --- a/libcxx/src/include/config_elast.h +++ b/libcxx/src/include/config_elast.h @@ -35,6 +35,8 @@ #define _LIBCPP_ELAST 4095 #elif defined(__APPLE__) // No _LIBCPP_ELAST needed on Apple +#elif defined(__serenity__) +// No _LIBCPP_ELAST needed on SerenityOS #elif defined(__MVS__) #define _LIBCPP_ELAST 1160 #elif defined(_LIBCPP_MSVCRT_LIKE)