File tree Expand file tree Collapse file tree
port/include/__locale_dir Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5252
5353#include <__config>
5454
55- #if _LIBCPP_HAS_LOCALIZATION && _LIBCPP_HAS_MUSL_LIBC && defined(__APPLE__ )
56- // The one case upstream's chain answers wrongly for this configuration. Every
57- // other target — including musl on ELF, where `__linux__` is defined and the
58- // chain already reaches the same header — falls through to upstream below.
55+ // ⭐ THE PREDICATE IS THE C LIBRARY, FULL STOP — NOT "the C library, on Apple".
56+ //
57+ // It was `&& defined(__APPLE__)` at first, because Apple was the target that
58+ // exposed it. Measured 2026-08-23 on the next one: `x86_64-windows-gnu` over
59+ // openkal takes `_LIBCPP_MSVCRT_LIKE` → `support/windows.h` and stops on
60+ // `_locale_t`, which is Microsoft's C runtime, for a program whose C library
61+ // is musl. Same shape, second object format.
62+ //
63+ // ⇒ Narrowing the rule to one platform would have meant writing it again per
64+ // platform. The question upstream asks is which C library is beneath; this
65+ // answers it, and every target where the answer is musl now reaches the same
66+ // backend — which on ELF is the one it already reached.
67+ #if _LIBCPP_HAS_LOCALIZATION && _LIBCPP_HAS_MUSL_LIBC
5968# include <__locale_dir/support/linux.h>
6069#else
6170# include_next <__locale_dir/locale_base_api.h>
You can’t perform that action at this time.
0 commit comments