diff --git a/posix.cc b/posix.cc index 4c086af6..33000cc6 100644 --- a/posix.cc +++ b/posix.cc @@ -97,7 +97,7 @@ void fmt::BufferedFile::close() { throw SystemError(errno, "cannot close file"); } -int fmt::BufferedFile::fileno() const { +int (fmt::BufferedFile::fileno)() const { int fd = FMT_POSIX_CALL(fileno(file_)); if (fd == -1) throw SystemError(errno, "cannot get file descriptor"); diff --git a/test/gtest-extra-test.cc b/test/gtest-extra-test.cc index 60cfcc89..3ba219a5 100644 --- a/test/gtest-extra-test.cc +++ b/test/gtest-extra-test.cc @@ -36,6 +36,10 @@ # include // for _CrtSetReportMode #endif // _WIN32 +#ifdef __MINGW32__ +# undef fileno +#endif + namespace { #if defined(_WIN32) && !defined(__MINGW32__)