diff options
author | Lucian Petrut <lpetrut@cloudbasesolutions.com> | 2020-05-22 07:18:50 +0000 |
---|---|---|
committer | Victor Zverovich <victor.zverovich@gmail.com> | 2020-05-26 06:39:22 -0700 |
commit | 51bf9cfacb644659e5d9c7e6fe66396726f2f4f4 (patch) | |
tree | 7a671c2d4470222869bd552b9429853d96fe094c /src | |
parent | 1a716caf5d39779f4791a40ad339c571b93fa2d0 (diff) | |
download | fmtlib-51bf9cfacb644659e5d9c7e6fe66396726f2f4f4.tar.gz |
Fix Mingw support
If the ``_POSIX_`` flag is set, _fdopen will not be defined by
Mingw headers, which is addressed by this commit.
For what is worth, as opposed to ``fdopen``, ``_pipe`` *will*
actually have the ``_`` prefix when ``_POSIX_`` is set.
Diffstat (limited to 'src')
-rw-r--r-- | src/os.cc | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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")); |