[libcxx-commits] [libcxx] [libc++] Simplify detection of win32-broken-utf8-wchar-ctype (PR #214797)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Mon Aug 10 05:58:33 PDT 2026


ldionne wrote:

> This works for me.
> 
> If the actual bug in the previous form just is the operator precedence in the python expression, wouldn't it also just be fixed by adding parentheses around `not "_LIBCPP_HAS_LOCALIZATION" in compilerMacros(cfg) or compilerMacros(cfg)["_LIBCPP_HAS_LOCALIZATION"] == "1"`?

Yes, that could also work. Instead, I opted to (IMO) simplify the whole thing by moving more of the carve-out detection from Python into C++. Basically, we now have a cheap check whether `_WIN32` is defined (since `compilerMacros` are memoized), and then we compile the full program if we need to. This way of fixing the issue also prepares the terrain for https://github.com/llvm/llvm-project/pull/214820 where we can reuse `test_macros.h` for feature detection instead.

https://github.com/llvm/llvm-project/pull/214797


More information about the libcxx-commits mailing list