From 4f09c3f9153b613f460a7626840493a978fa13f7 Mon Sep 17 00:00:00 2001 From: yami-hack Date: Mon, 13 Jun 2016 17:44:21 +0800 Subject: [PATCH] Update file_util.cpp Use mingw32 macro definition "defined(MINGW_HAS_SECURE_API)" support "_s" functions,and "!defined(MINGW_HAS_SECURE_API)" disable "_s" functions supported --- src/common/file_util.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp index 3c7dd8c69..b059e8be8 100644 --- a/src/common/file_util.cpp +++ b/src/common/file_util.cpp @@ -928,7 +928,7 @@ bool IOFile::Open(const std::string& filename, const char openmode[]) { Close(); #ifdef _WIN32 -#if defined(__MINGW64__) +#if defined(__MINGW64__) && !defined(MINGW_HAS_SECURE_API) m_file = _wfsopen(Common::UTF8ToUTF16W(filename).c_str(), Common::UTF8ToUTF16W(openmode).c_str(), SH_DENYNO); #else _wfopen_s(&m_file, Common::UTF8ToUTF16W(filename).c_str(), Common::UTF8ToUTF16W(openmode).c_str()); @@ -987,7 +987,7 @@ bool IOFile::Resize(u64 size) if (!IsOpen() || 0 != #ifdef _WIN32 -#if defined(__MINGW64__) +#if defined(__MINGW64__) && !defined(MINGW_HAS_SECURE_API) //TDM-GCC64 does not supports _chsize_s ?in _chsize(_fileno(m_file), size) #else