mirror of
https://github.com/fmtlib/fmt.git
synced 2026-04-30 19:09:22 +08:00
Fix bug re: return type of f(un)lockfile wrappers for Windows (#4739)
Just a tiny bugfix I spotted: The `f(un)lockfile` wrappers in `format-inl.h` that wrap Windows's `_(un)lock_file` methods are defined with a trailing return type derived by using decltype on a hypothetical call to the underlying functions. The wrappers don't contain a `return` in their bodies, however, so if the return type of the underlying functions were to ever change from `void`, there would be a compile error. This just adds `return` to each.
This commit is contained in:
parent
9396f77fe4
commit
be98ea8add
@ -1477,10 +1477,10 @@ template <typename T> struct span {
|
||||
};
|
||||
|
||||
template <typename F> auto flockfile(F* f) -> decltype(_lock_file(f)) {
|
||||
_lock_file(f);
|
||||
return _lock_file(f);
|
||||
}
|
||||
template <typename F> auto funlockfile(F* f) -> decltype(_unlock_file(f)) {
|
||||
_unlock_file(f);
|
||||
return _unlock_file(f);
|
||||
}
|
||||
|
||||
#ifndef getc_unlocked
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user