-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Fix compat between libc++ and emscripten's xlocale.h #23414
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
Conversation
@@ -25,8 +27,6 @@ | |||
# 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> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would adding emscripten here be less of a diff, so less churn in the next libc++ update? Or must the change be on top?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not possible because we would already have hit the _LIBCPP_HAS_MUSL_LIBC case above. Our case needs to come first.
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: emscripten-core#23413
Before, the code was like https://github.com/emscripten-core/emscripten/blob/dc1abd514b1bade135a01a4453a9ff6def0793b6/system/lib/libcxx/include/__locale_dir/locale_base_api.h#L12-L30 But now they are divided into two parts, one using the new API and the other using old. See "Locale API reimplementation" above. https://github.com/llvm/llvm-project/blob/ec28b8f9cc7f2ac187d8a617a6d08d5e56f9120e/libcxx/include/__locale_dir/locale_base_api.h#L116-L138 This adds Emscripten in the beginning of the "old" API list. (This has to be the beginning; see emscripten-core#23414)
Before, the code was like https://github.com/emscripten-core/emscripten/blob/dc1abd514b1bade135a01a4453a9ff6def0793b6/system/lib/libcxx/include/__locale_dir/locale_base_api.h#L12-L30 But now they are divided into two parts, one using the new API and the other using old. See "Locale API reimplementation" above. https://github.com/llvm/llvm-project/blob/ec28b8f9cc7f2ac187d8a617a6d08d5e56f9120e/libcxx/include/__locale_dir/locale_base_api.h#L116-L138 This adds Emscripten in the beginning of the "old" API list. (This has to be the beginning; see emscripten-core#23414)
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