mirror of
https://github.com/fmtlib/fmt.git
synced 2026-02-05 17:30:06 +08:00
Add FMT_USE_FLOCKFILE macro to force has_flockfile trait to false (#4666)
Fixes fmtlib/fmt#4646
This commit is contained in:
parent
eb99f6eba6
commit
2eda43e9be
@ -1489,12 +1489,16 @@ template <typename F> auto getc_unlocked(F* f) -> decltype(_fgetc_nolock(f)) {
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef FMT_USE_FLOCKFILE
|
||||
# define FMT_USE_FLOCKFILE 1
|
||||
#endif
|
||||
|
||||
template <typename F = FILE, typename Enable = void>
|
||||
struct has_flockfile : std::false_type {};
|
||||
|
||||
template <typename F>
|
||||
struct has_flockfile<F, void_t<decltype(flockfile(&std::declval<F&>()))>>
|
||||
: std::true_type {};
|
||||
: bool_constant<FMT_USE_FLOCKFILE != 0> {};
|
||||
|
||||
// A FILE wrapper. F is FILE defined as a template parameter to make system API
|
||||
// detection work.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user