[libcxx-commits] [libcxx] [libc++] Prevent cycle from including __mbstate_t.h within wchar.h (PR #200940)

Zibi Sarbinowski via libcxx-commits libcxx-commits at lists.llvm.org
Mon Nov 2 06:52:31 PST 2026


zibi2 wrote:

CI is now fully green — all checks passing including `stage1 (frozen-cxx03-headers)`, Android (x86 + x86_64), AIX, FreeBSD, macOS, Windows, and all stage1/stage2/stage3 jobs.

Since the last review, three additional fixes were pushed to resolve CI failures:

1. **`__cxx03/__fwd/mbstate_t.h`** — added a cxx03-namespaced copy of `__fwd/mbstate_t.h` using `__cxx03/__config` to fix `-Wmacro-redefined` errors in the `frozen-cxx03-headers` build where both `__config` and `__cxx03/__config` define the same macros.
2. **`-Wundef` fix** — changed bare `#if _LIBCPP_HAS_MUSL_LIBC` / `#elif _LIBCPP_LIBC_LLVM_LIBC` to `defined()` checks in `__cxx03/__fwd/mbstate_t.h`, since the `frozen-cxx03-headers` build uses `-Wundef`.
3. **`config_site_shim.h`** — added the missing `undef` block for `_LIBCPP_LIBC_LLVM_LIBC` to prevent it leaking into the `__cxx03` world as a `cmakedefine01`-defined `0`-valued macro, which caused `__cxx03/__fwd/mbstate_t.h` to attempt `#include <llvm-libc-types/mbstate_t.h>` on the LLVM-libc CI runner.

@ldionne @philnik777 — could you take another look?




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


More information about the libcxx-commits mailing list