From 6bca5ca1090fcb10cd1c9bdcb08984d5bc213ffe Mon Sep 17 00:00:00 2001 From: vitaut Date: Thu, 12 Mar 2015 07:49:01 -0700 Subject: [PATCH] Woraround a bug in MinGW --- posix.cc | 2 +- test/gtest-extra-test.cc | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) 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__)