Skip to content

Commit 767e60c

Browse files
committed
[libc++] Refactor the Windows and MinGW implementation of the locale base API
This patch reimplements the locale base support for Windows flavors in a way that is more modules-friendly and without defining non-internal names. Since this changes the name of some types and entry points in the built library, this is effectively an ABI break on Windows (which is acceptable since we don't promise ABI stability on that platform).
1 parent 81c8813 commit 767e60c

File tree

8 files changed

+416
-341
lines changed

8 files changed

+416
-341
lines changed

libcxx/docs/ReleaseNotes/20.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,9 @@ ABI Affecting Changes
152152
- When using the MSVC ABI, this change results in some classes having a completely different memory layout, so this is
153153
a genuine ABI break. However, the library does not currently guarantee ABI stability on MSVC platforms.
154154

155+
- The localization support base API has been reimplemented, leading to different functions being exported from the
156+
libc++ built library on Windows and Windows-like platforms.
157+
155158
Build System Changes
156159
--------------------
157160

libcxx/include/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,12 +500,12 @@ set(files
500500
__locale_dir/locale_base_api/ibm.h
501501
__locale_dir/locale_base_api/musl.h
502502
__locale_dir/locale_base_api/openbsd.h
503-
__locale_dir/locale_base_api/win32.h
504503
__locale_dir/locale_guard.h
505504
__locale_dir/pad_and_output.h
506505
__locale_dir/support/apple.h
507506
__locale_dir/support/bsd_like.h
508507
__locale_dir/support/freebsd.h
508+
__locale_dir/support/windows.h
509509
__math/abs.h
510510
__math/copysign.h
511511
__math/error_functions.h

libcxx/include/__locale_dir/locale_base_api.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,15 @@
9898
# include <__locale_dir/support/apple.h>
9999
#elif defined(__FreeBSD__)
100100
# include <__locale_dir/support/freebsd.h>
101+
#elif defined(_LIBCPP_MSVCRT_LIKE)
102+
# include <__locale_dir/support/windows.h>
101103
#else
102104

103105
// TODO: This is a temporary definition to bridge between the old way we defined the locale base API
104106
// (by providing global non-reserved names) and the new API. As we move individual platforms
105107
// towards the new way of defining the locale base API, this should disappear since each platform
106108
// will define those directly.
107-
# if defined(_LIBCPP_MSVCRT_LIKE)
108-
# include <__locale_dir/locale_base_api/win32.h>
109-
# elif defined(_AIX) || defined(__MVS__)
109+
# if defined(_AIX) || defined(__MVS__)
110110
# include <__locale_dir/locale_base_api/ibm.h>
111111
# elif defined(__ANDROID__)
112112
# include <__locale_dir/locale_base_api/android.h>

libcxx/include/__locale_dir/locale_base_api/win32.h

Lines changed: 0 additions & 235 deletions
This file was deleted.

0 commit comments

Comments
 (0)