mirror of
https://github.com/fmtlib/fmt.git
synced 2025-02-03 20:54:08 +00:00
Fix handling of the fileno macro
This commit is contained in:
parent
6c7cc6a06f
commit
38881e5acf
10
src/os.cc
10
src/os.cc
@ -182,12 +182,12 @@ void buffered_file::close() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int buffered_file::descriptor() const {
|
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_));
|
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
|
#else
|
||||||
int fd = fileno(file_);
|
int fd = fileno(file_);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user