diff --git a/src/os.cc b/src/os.cc index 70a4a04c4d3d3..cfd86e819a73a 100644 --- a/src/os.cc +++ b/src/os.cc @@ -183,11 +183,9 @@ void buffered_file::close() { int buffered_file::descriptor() const { #ifdef FMT_HAS_SYSTEM - // fileno is a macro on OpenBSD. -# ifdef fileno -# undef fileno -# endif int fd = FMT_POSIX_CALL(fileno(file_)); +#elif defined(_WIN32) + int fd = _fileno(file_); #else int fd = fileno(file_); #endif