diff --git a/posix.cc b/posix.cc index 33000cc6..945c796c 100644 --- a/posix.cc +++ b/posix.cc @@ -106,7 +106,7 @@ int (fmt::BufferedFile::fileno)() const { fmt::File::File(fmt::StringRef path, int oflag) { int mode = S_IRUSR | S_IWUSR; -#ifdef _WIN32 +#if defined(_WIN32) && !defined(__MINGW32__) fd_ = -1; FMT_POSIX_CALL(sopen_s(&fd_, path.c_str(), oflag, _SH_DENYNO, mode)); #else diff --git a/posix.h b/posix.h index 5acf64c6..cbe2466e 100644 --- a/posix.h +++ b/posix.h @@ -63,7 +63,7 @@ // Fix warnings about deprecated symbols. # define FMT_POSIX_CALL(call) ::_##call # else -# define FMT_POSIX_CALL(call) ::call +# define FMT_POSIX_CALL(call) (::call) # endif #endif