From 6d8a0c301bed97977dd23a9a2f2d9cadc143b4bd Mon Sep 17 00:00:00 2001 From: Matthias Moulin Date: Sun, 7 Apr 2024 12:50:27 +0200 Subject: [PATCH] Resolved warning C4996: 'fileno': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _fileno. --- src/os.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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