From cd8a9d99dfc479d78ea9268a15d24af993b953ab Mon Sep 17 00:00:00 2001 From: AnonymousPC Date: Sun, 6 Jul 2025 01:38:11 +0800 Subject: [PATCH] fix module-compilation error when defined `FMT_IMPORT_STD` --- include/fmt/std.h | 2 +- src/fmt.cc | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/fmt/std.h b/include/fmt/std.h index fff6da9d..9b3709f5 100644 --- a/include/fmt/std.h +++ b/include/fmt/std.h @@ -225,7 +225,7 @@ template struct is_bit_reference_like { // Workaround for libc++ incompatibility with C++ standard. // According to the Standard, `bitset::operator[] const` returns bool. -#ifdef _LIBCPP_VERSION +#if defined(_LIBCPP_VERSION) && !defined(FMT_IMPORT_STD) template struct is_bit_reference_like> { static constexpr bool value = true; diff --git a/src/fmt.cc b/src/fmt.cc index 671fd695..11e4499c 100644 --- a/src/fmt.cc +++ b/src/fmt.cc @@ -51,6 +51,8 @@ module; # include # include # include +# include +# include #endif #include #include