From c6d3a7320197c93525b4ae529910533d5d4a9399 Mon Sep 17 00:00:00 2001 From: vitaut Date: Mon, 16 Mar 2015 08:43:59 -0700 Subject: [PATCH] Workaround MinGW's braindamage --- posix.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/posix.cc b/posix.cc index f41f4341..f5060616 100644 --- a/posix.cc +++ b/posix.cc @@ -98,8 +98,11 @@ void fmt::BufferedFile::close() { throw SystemError(errno, "cannot close file"); } +// A macro used to prevent expansion of fileno on broken versions of MinGW. +#define FMT_ARGS + int fmt::BufferedFile::fileno() const { - int fd = FMT_POSIX_CALL(fileno(file_)); + int fd = FMT_POSIX_CALL(fileno FMT_ARGS(file_)); if (fd == -1) throw SystemError(errno, "cannot get file descriptor"); return fd;