-
Notifications
You must be signed in to change notification settings - Fork 13.5k
[libc++] Split Apple and Freebsd locale support into their own headers #113737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[libc++] Split Apple and Freebsd locale support into their own headers #113737
Conversation
For now these headers don't provide much benefit, however as we refactor the locale base API they will provide a location to specify the localization interface on these platforms.
@llvm/pr-subscribers-libcxx Author: Louis Dionne (ldionne) ChangesFor now these headers don't provide much benefit, however as we refactor the locale base API they will provide a location to specify the localization interface on these platforms. Full diff: https://github.com/llvm/llvm-project/pull/113737.diff 5 Files Affected:
diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt
index 506ed721d0843e..bb152af82cad5c 100644
--- a/libcxx/include/CMakeLists.txt
+++ b/libcxx/include/CMakeLists.txt
@@ -492,8 +492,10 @@ set(files
__locale
__locale_dir/locale_base_api.h
__locale_dir/locale_base_api/android.h
+ __locale_dir/locale_base_api/apple.h
__locale_dir/locale_base_api/bsd_locale_defaults.h
__locale_dir/locale_base_api/bsd_locale_fallbacks.h
+ __locale_dir/locale_base_api/freebsd.h
__locale_dir/locale_base_api/fuchsia.h
__locale_dir/locale_base_api/ibm.h
__locale_dir/locale_base_api/musl.h
diff --git a/libcxx/include/__locale_dir/locale_base_api.h b/libcxx/include/__locale_dir/locale_base_api.h
index eab7fa8bf62fae..b6c80255b4d199 100644
--- a/libcxx/include/__locale_dir/locale_base_api.h
+++ b/libcxx/include/__locale_dir/locale_base_api.h
@@ -21,8 +21,10 @@
# 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>
+#elif defined(__APPLE__)
+# include <__locale_dir/locale_base_api/apple.h>
+#elif defined(__FreeBSD__)
+# include <__locale_dir/locale_base_api/freebsd.h>
#endif
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
diff --git a/libcxx/include/__locale_dir/locale_base_api/apple.h b/libcxx/include/__locale_dir/locale_base_api/apple.h
new file mode 100644
index 00000000000000..ec5986c3a19f10
--- /dev/null
+++ b/libcxx/include/__locale_dir/locale_base_api/apple.h
@@ -0,0 +1,15 @@
+// -*- C++ -*-
+//===-----------------------------------------------------------------------===//
+//
+// 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_APPLE_H
+#define _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_APPLE_H
+
+#include <xlocale.h>
+
+#endif // _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_APPLE_H
diff --git a/libcxx/include/__locale_dir/locale_base_api/freebsd.h b/libcxx/include/__locale_dir/locale_base_api/freebsd.h
new file mode 100644
index 00000000000000..45ecf1977471b8
--- /dev/null
+++ b/libcxx/include/__locale_dir/locale_base_api/freebsd.h
@@ -0,0 +1,15 @@
+// -*- C++ -*-
+//===-----------------------------------------------------------------------===//
+//
+// 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_FREEBSD_H
+#define _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_FREEBSD_H
+
+#include <xlocale.h>
+
+#endif // _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_FREEBSD_H
diff --git a/libcxx/include/module.modulemap b/libcxx/include/module.modulemap
index f92e8bf5fc9aba..05d08cfbd7cd29 100644
--- a/libcxx/include/module.modulemap
+++ b/libcxx/include/module.modulemap
@@ -1446,8 +1446,10 @@ module std [system] {
header "__locale_dir/locale_guard.h"
module locale_base_api {
textual header "__locale_dir/locale_base_api/android.h"
+ textual header "__locale_dir/locale_base_api/apple.h"
textual header "__locale_dir/locale_base_api/bsd_locale_defaults.h"
textual header "__locale_dir/locale_base_api/bsd_locale_fallbacks.h"
+ textual header "__locale_dir/locale_base_api/freebsd.h"
textual header "__locale_dir/locale_base_api/fuchsia.h"
textual header "__locale_dir/locale_base_api/ibm.h"
textual header "__locale_dir/locale_base_api/musl.h"
|
llvm#113737) For now these headers don't provide much benefit, however as we refactor the locale base API they will provide a location to specify the localization interface on these platforms.
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/24/builds/2296 Here is the relevant piece of the build log for the reference
|
llvm#113737) For now these headers don't provide much benefit, however as we refactor the locale base API they will provide a location to specify the localization interface on these platforms.
For now these headers don't provide much benefit, however as we refactor the locale base API they will provide a location to specify the localization interface on these platforms.