From ae6fd83e2ee09ac260f30bbd33f2071e99f972de Mon Sep 17 00:00:00 2001 From: Victor Chernyakin Date: Fri, 13 Mar 2026 17:51:48 -0700 Subject: [PATCH] Make fmt/fmt-c.h compile with Clang on Windows (#4712) --- include/fmt/fmt-c.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/fmt/fmt-c.h b/include/fmt/fmt-c.h index aa283463..ce878fdc 100644 --- a/include/fmt/fmt-c.h +++ b/include/fmt/fmt-c.h @@ -91,14 +91,15 @@ static inline fmt_arg fmt_from_ptr(const void* x) { void fmt_unsupported_type(void); -# ifndef _MSC_VER +# if !defined(_MSC_VER) || defined(__clang__) typedef signed char fmt_signed_char; # else typedef enum {} fmt_signed_char; # endif // Require modern MSVC with conformant preprocessor. -# if defined(_MSC_VER) && (!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL) +# if defined(_MSC_VER) && !defined(__clang__) && \ + (!defined(_MSVC_TRADITIONAL) || _MSVC_TRADITIONAL) # error "C API requires MSVC 2019+ with /Zc:preprocessor flag." # endif