[libcxx-commits] [libcxx] [libcxx] Fix freestanding build with filesystem disabled on Windows (PR #164602)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Oct 24 10:33:12 PDT 2025
ldionne wrote:
I don't think implementing what @philnik777 is suggesting is necessarily that big of a deal. We already refactored a lot of the locale API layer and we're down to something fairly clean, except for the old shim layer we still have for a few platforms. It's certainly not trivial, but I think this is the easiest and cleanest path to fixing this issue properly and for the long term.
For example, we have started creating bundles of locale functions that can be reused when you want to assume the C locale: https://github.com/llvm/llvm-project/blob/main/libcxx/include/__locale_dir/support/fuchsia.h#L158
> I understand the principle. The issue is that the path implementation on Windows has hard dependencies on localization and wide characters
It's more than a principle, though. There's a reason why we enabled some parts of `<filesystem>` on platforms where no filesystem is available: people wanted to do e.g. path manipulation and that's entirely fine since that's just string operations under the hood. So there are actual users of this, which this patch would break. I totally understand what you're trying to achieve, however the library is currently designed in this way for a reason, so we'll need to keep that working.
I do think that being able to assume the C locale (by providing the appropriate locale base API layer) on platforms that don't support localization is the right approach, and it would greatly simplify other things. For example, we'd get rid of `_LIBCPP_HAS_NO_LOCALIZATION` in probably 90% of the places where it's currently used.
https://github.com/llvm/llvm-project/pull/164602
More information about the libcxx-commits
mailing list