Skip to content

Commit 2eda43e

Browse files
authored
Add FMT_USE_FLOCKFILE macro to force has_flockfile trait to false (#4666)
Fixes #4646
1 parent eb99f6e commit 2eda43e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

include/fmt/format-inl.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1489,12 +1489,16 @@ template <typename F> auto getc_unlocked(F* f) -> decltype(_fgetc_nolock(f)) {
14891489
}
14901490
#endif
14911491

1492+
#ifndef FMT_USE_FLOCKFILE
1493+
# define FMT_USE_FLOCKFILE 1
1494+
#endif
1495+
14921496
template <typename F = FILE, typename Enable = void>
14931497
struct has_flockfile : std::false_type {};
14941498

14951499
template <typename F>
14961500
struct has_flockfile<F, void_t<decltype(flockfile(&std::declval<F&>()))>>
1497-
: std::true_type {};
1501+
: bool_constant<FMT_USE_FLOCKFILE != 0> {};
14981502

14991503
// A FILE wrapper. F is FILE defined as a template parameter to make system API
15001504
// detection work.

0 commit comments

Comments
 (0)