Skip to content

Commit a84a9b1

Browse files
committed
Resolved warning C4996: 'fileno': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _fileno.
1 parent 116a9ce commit a84a9b1

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

Diff for: src/os.cc

+2-6
Original file line numberDiff line numberDiff line change
@@ -183,13 +183,9 @@ void buffered_file::close() {
183183

184184
int buffered_file::descriptor() const {
185185
#ifdef FMT_HAS_SYSTEM
186-
// fileno is a macro on OpenBSD.
187-
# ifdef fileno
188-
# undef fileno
189-
# endif
190-
int fd = FMT_POSIX_CALL(fileno(file_));
186+
int fd = FMT_POSIX_CALL(_fileno(file_));
191187
#else
192-
int fd = fileno(file_);
188+
int fd = _fileno(file_);
193189
#endif
194190
if (fd == -1)
195191
FMT_THROW(system_error(errno, FMT_STRING("cannot get file descriptor")));

0 commit comments

Comments
 (0)