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:
Mike Vastola 2026-04-10 11:01:13 -04:00 committed by GitHub
parent 9396f77fe4
commit be98ea8add
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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