Skip to content

[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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions libcxx/include/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions libcxx/include/__locale_dir/locale_base_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
15 changes: 15 additions & 0 deletions libcxx/include/__locale_dir/locale_base_api/apple.h
Original file line number Diff line number Diff line change
@@ -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
15 changes: 15 additions & 0 deletions libcxx/include/__locale_dir/locale_base_api/freebsd.h
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions libcxx/include/module.modulemap
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading