Skip to content

Commit 72cfbcc

Browse files
committed
Fix compat between libc++ and emscripten's xlocale.h
libc++ was assuming that musl doesn't have `xlocale.h` which is true, but emscripten adds xlocale.h for compatibility (I'm not sure we really need to, but we do). Fixes: #23413
1 parent 6bed395 commit 72cfbcc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

system/lib/libcxx/include/__locale_dir/locale_base_api.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
#ifndef _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_H
1010
#define _LIBCPP___LOCALE_DIR_LOCALE_BASE_API_H
1111

12-
#if defined(_LIBCPP_MSVCRT_LIKE)
12+
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__EMSCRIPTEN__)
13+
# include <xlocale.h>
14+
#elif defined(_LIBCPP_MSVCRT_LIKE)
1315
# include <__locale_dir/locale_base_api/win32.h>
1416
#elif defined(_AIX) || defined(__MVS__)
1517
# include <__locale_dir/locale_base_api/ibm.h>
@@ -25,8 +27,6 @@
2527
# include <__locale_dir/locale_base_api/fuchsia.h>
2628
#elif defined(__wasi__) || defined(_LIBCPP_HAS_MUSL_LIBC)
2729
# include <__locale_dir/locale_base_api/musl.h>
28-
#elif defined(__APPLE__) || defined(__FreeBSD__)
29-
# include <xlocale.h>
3030
#endif
3131

3232
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)

0 commit comments

Comments
 (0)