[libcxx-commits] [libcxx] [libc++] Move the locale support headers to __locale_dir/locale_base_api/ (PR #74522)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Thu Dec 21 09:16:29 PST 2023


================
@@ -0,0 +1,63 @@
+//===-----------------------------------------------------------------------===//
+//
+// 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___LOCALE_DIR_LOCALE_BASE_API_H
+#define _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_H
+
+#if defined(_LIBCPP_MSVCRT_LIKE)
+#  include <__locale_dir/locale_base_api/win32.h>
+#elif defined(_AIX) || defined(__MVS__)
+#  include <__locale_dir/locale_base_api/ibm.h>
+#elif defined(__ANDROID__)
+#  include <__locale_dir/locale_base_api/android.h>
+#elif defined(__sun__)
+#  include <__locale_dir/locale_base_api/solaris.h>
+#elif defined(_NEWLIB_VERSION)
+#  include <__locale_dir/locale_base_api/newlib.h>
+#elif defined(__OpenBSD__)
+#  include <__locale_dir/locale_base_api/openbsd.h>
+#elif defined(__Fuchsia__)
+#  include <__locale_dir/locale_base_api/fuchsia.h>
+#elif defined(__wasi__) || defined(_LIBCPP_HAS_MUSL_LIBC)
+#  include <__locale_dir/locale_base_api/musl.h>
+#elif defined(__APPLE__) || defined(__FreeBSD__)
+#  include <xlocale.h>
+#endif
+
+#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
+#  pragma GCC system_header
+#endif
+
+/*
+The platform-specific headers have to provide the following interface:
+
+// TODO: rename this to __libcpp_locale_t
+using locale_t = //implementation-defined//;
----------------
ldionne wrote:

I would suggest using `implementation-defined` instead of `//implementation-defined//`. I understand you want to italicize it, but IMO it just makes it a bit harder to parse since `//` is normally a C++ comment.

https://github.com/llvm/llvm-project/pull/74522


More information about the libcxx-commits mailing list