Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
srz-zumix committed May 30, 2022
1 parent fb8d0c3 commit f22c497
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/internal/iutest_file.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,10 +408,14 @@ class TempFile : public IFile
IUTEST_PRAGMA_CRT_SECURE_WARN_DISABLE_BEGIN()
const int fd = _creat(name_template, _S_IREAD | _S_IWRITE);
IUTEST_PRAGMA_CRT_SECURE_WARN_DISABLE_END()
#else
#if defined(IUTEST_OS_WINDOWS_MINGW)
const int fd = _sopen(name_template, _O_CREAT | _O_RDWR, _SH_DENYNO, _S_IREAD | _S_IWRITE);
#else
int fd = -1;
_sopen_s(&fd, name_template, _O_CREAT | _O_RDWR, _SH_DENYNO, _S_IREAD | _S_IWRITE);
#endif
#endif
#else
#if defined(IUTEST_OS_LINUX_ANDROID)
::std::string name_template = "/data/local/tmp/";
Expand Down
2 changes: 2 additions & 0 deletions include/internal/iutest_stdlib_defs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,8 @@
# if !defined(__STRICT_ANSI__)
# define IUTEST_HAS_MKSTEMP 1
# endif
# elif defined(IUTEST_OS_WINDOWS_MINGW) && !defined(__MINGW64__)
# define IUTEST_HAS_MKSTEMP 0
# elif IUTEST_HAS_HDR_UNISTD
# define IUTEST_HAS_MKSTEMP 1
# endif
Expand Down

0 comments on commit f22c497

Please sign in to comment.