Skip to content

Commit

Permalink
Fix handling of the fileno macro
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed Mar 19, 2024
1 parent c0dac83 commit 8ecb77f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/os.cc
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,12 @@ void buffered_file::close() {
}

int buffered_file::descriptor() const {
#if !defined(fileno)
#ifdef FMT_HAS_SYSTEM
// fileno is a macro on OpenBSD.
# ifdef fileno
# undef fileno
# endif
int fd = FMT_POSIX_CALL(fileno(file_));
#elif defined(FMT_HAS_SYSTEM)
// fileno is a macro on OpenBSD so we cannot use FMT_POSIX_CALL.
# define FMT_DISABLE_MACRO
int fd = FMT_SYSTEM(fileno FMT_DISABLE_MACRO(file_));
#else
int fd = fileno(file_);
#endif
Expand Down

0 comments on commit 8ecb77f

Please sign in to comment.