Skip to content
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++] Refactor the Windows and MinGW implementation of the locale base API #115752

Merged
merged 1 commit into from
Dec 16, 2024
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
3 changes: 3 additions & 0 deletions libcxx/docs/ReleaseNotes/20.rst
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ ABI Affecting Changes
- When using the MSVC ABI, this change results in some classes having a completely different memory layout, so this is
a genuine ABI break. However, the library does not currently guarantee ABI stability on MSVC platforms.

- The localization support base API has been reimplemented, leading to different functions being exported from the
libc++ built library on Windows and Windows-like platforms.

Build System Changes
--------------------

Expand Down
2 changes: 1 addition & 1 deletion libcxx/include/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -503,12 +503,12 @@ set(files
__locale_dir/locale_base_api/ibm.h
__locale_dir/locale_base_api/musl.h
__locale_dir/locale_base_api/openbsd.h
__locale_dir/locale_base_api/win32.h
__locale_dir/locale_guard.h
__locale_dir/pad_and_output.h
__locale_dir/support/apple.h
__locale_dir/support/bsd_like.h
__locale_dir/support/freebsd.h
__locale_dir/support/windows.h
__math/abs.h
__math/copysign.h
__math/error_functions.h
Expand Down
6 changes: 3 additions & 3 deletions libcxx/include/__locale_dir/locale_base_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,15 @@
# include <__locale_dir/support/apple.h>
#elif defined(__FreeBSD__)
# include <__locale_dir/support/freebsd.h>
#elif defined(_LIBCPP_MSVCRT_LIKE)
# include <__locale_dir/support/windows.h>
#else

// TODO: This is a temporary definition to bridge between the old way we defined the locale base API
// (by providing global non-reserved names) and the new API. As we move individual platforms
// towards the new way of defining the locale base API, this should disappear since each platform
// will define those directly.
# if defined(_LIBCPP_MSVCRT_LIKE)
# include <__locale_dir/locale_base_api/win32.h>
# elif defined(_AIX) || defined(__MVS__)
# if defined(_AIX) || defined(__MVS__)
# include <__locale_dir/locale_base_api/ibm.h>
# elif defined(__ANDROID__)
# include <__locale_dir/locale_base_api/android.h>
Expand Down
235 changes: 0 additions & 235 deletions libcxx/include/__locale_dir/locale_base_api/win32.h

This file was deleted.

2 changes: 1 addition & 1 deletion libcxx/include/__locale_dir/locale_guard.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD

#if defined(_LIBCPP_MSVCRT_LIKE)
struct __locale_guard {
__locale_guard(locale_t __l) : __status(_configthreadlocale(_ENABLE_PER_THREAD_LOCALE)) {
__locale_guard(__locale::__locale_t __l) : __status(_configthreadlocale(_ENABLE_PER_THREAD_LOCALE)) {
// Setting the locale can be expensive even when the locale given is
// already the current locale, so do an explicit check to see if the
// current locale is already the one we want.
Expand Down
Loading
Loading