Skip to content

Commit

Permalink
Resolved warning C4996: 'fileno': The POSIX name for this item is dep…
Browse files Browse the repository at this point in the history
…recated. Instead, use the ISO C and C++ conformant name: _fileno.
  • Loading branch information
matt77hias committed Apr 10, 2024
1 parent 116a9ce commit a84a9b1
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/os.cc
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +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_));
int fd = FMT_POSIX_CALL(_fileno(file_));
#else
int fd = fileno(file_);
int fd = _fileno(file_);
#endif
if (fd == -1)
FMT_THROW(system_error(errno, FMT_STRING("cannot get file descriptor")));
Expand Down

0 comments on commit a84a9b1

Please sign in to comment.