From 2eda43e9be177109a1557a59eee3fe7825a9b479 Mon Sep 17 00:00:00 2001 From: Mike Vastola Date: Tue, 3 Feb 2026 15:45:07 -0500 Subject: [PATCH] Add FMT_USE_FLOCKFILE macro to force has_flockfile trait to false (#4666) Fixes fmtlib/fmt#4646 --- include/fmt/format-inl.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/fmt/format-inl.h b/include/fmt/format-inl.h index 838ac7df..76eed5f1 100644 --- a/include/fmt/format-inl.h +++ b/include/fmt/format-inl.h @@ -1489,12 +1489,16 @@ template auto getc_unlocked(F* f) -> decltype(_fgetc_nolock(f)) { } #endif +#ifndef FMT_USE_FLOCKFILE +# define FMT_USE_FLOCKFILE 1 +#endif + template struct has_flockfile : std::false_type {}; template struct has_flockfile()))>> - : std::true_type {}; + : bool_constant {}; // A FILE wrapper. F is FILE defined as a template parameter to make system API // detection work.