diff --git a/include/fmt/os.h b/include/fmt/os.h index 8aa474a6..31df8eea 100644 --- a/include/fmt/os.h +++ b/include/fmt/os.h @@ -50,7 +50,7 @@ #ifdef FMT_SYSTEM # define FMT_POSIX_CALL(call) FMT_SYSTEM(call) #else -# define FMT_SYSTEM(call) call +# define FMT_SYSTEM(call) ::call # ifdef _WIN32 // Fix warnings about deprecated symbols. # define FMT_POSIX_CALL(call) ::_##call diff --git a/src/os.cc b/src/os.cc index abf6a380..386119db 100644 --- a/src/os.cc +++ b/src/os.cc @@ -289,7 +289,11 @@ void file::pipe(file& read_end, file& write_end) { buffered_file file::fdopen(const char* mode) { // Don't retry as fdopen doesn't return EINTR. + #if defined(__MINGW32__) && defined(_POSIX_) + FILE* f = ::fdopen(fd_, mode); + #else FILE* f = FMT_POSIX_CALL(fdopen(fd_, mode)); + #endif if (!f) FMT_THROW( system_error(errno, "cannot associate stream with file descriptor"));