From 8c68e2ca045d6abaaa4405183a9b34494b47419e Mon Sep 17 00:00:00 2001 From: vitaut Date: Thu, 10 Mar 2016 07:16:48 -0800 Subject: [PATCH] Fix fileno causing compile error when #defined Error: expected unqualified-id before '(' token int fmt::BufferedFile::fileno() const { This is an issue with Android NDK and mingw32. https://github.com/Gachapen/cppformat/commit/c2ffa146841535080a3483471fd9eec77c119c36 --- posix.cc | 5 ++++- test/posix-test.cc | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/posix.cc b/posix.cc index d36871f4..756281a0 100644 --- a/posix.cc +++ b/posix.cc @@ -55,11 +55,14 @@ # ifdef __MINGW32__ # define _SH_DENYNO 0x40 -# undef fileno # endif #endif // _WIN32 +#ifdef fileno +# undef fileno +#endif + namespace { #ifdef _WIN32 // Return type of read and write functions. diff --git a/test/posix-test.cc b/test/posix-test.cc index 7dd0dbb0..007e2507 100644 --- a/test/posix-test.cc +++ b/test/posix-test.cc @@ -31,7 +31,7 @@ #include "posix.h" #include "util.h" -#ifdef __MINGW32__ +#ifdef fileno # undef fileno #endif