diff --git a/format-test.cc b/format-test.cc index d0ff60e5..71b6592b 100644 --- a/format-test.cc +++ b/format-test.cc @@ -43,11 +43,15 @@ #endif #if FMT_USE_DUP + # include # include # include + # ifdef _WIN32 + # include + # define O_WRONLY _O_WRONLY # define O_CREAT _O_CREAT # define O_TRUNC _O_TRUNC @@ -57,6 +61,13 @@ # define close _close # define dup _dup # define dup2 _dup2 + +namespace { +int open(const char *path, int oflag, int pmode) { + _sopen_s(fd, path, oflag, _SH_DENYNO, pmode); + return fd; +} +} # else # include # endif