From 7ad88eff1315e81062faea37d34c2a63f9fa7579 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Tue, 29 Apr 2014 05:54:36 -0700 Subject: [PATCH] Fix a warning. --- format-test.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) 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