From 25a370ef191572c9eeba44fc2f8b75658dbcc884 Mon Sep 17 00:00:00 2001 From: Weiyi Wang Date: Sat, 13 Oct 2018 11:57:21 -0400 Subject: [PATCH] only redefine 64 bit file operation for MSVC MinGW provides POSIX functions --- src/common/file_util.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp index 40ea885b8..b2f9b8d7e 100644 --- a/src/common/file_util.cpp +++ b/src/common/file_util.cpp @@ -14,21 +14,24 @@ #ifdef _WIN32 #include // windows.h needs to be included before other windows headers -#include // for GetSaveFileName -#include // getcwd +#include // getcwd #include #include #include // for SHGetFolderPath #include #include "common/string_util.h" -// 64 bit offsets for windows +#ifdef _MSC_VER +// 64 bit offsets for MSVC #define fseeko _fseeki64 #define ftello _ftelli64 -#define atoll _atoi64 +#define fileno _fileno +#endif + +// 64 bit offsets for MSVC and MinGW. MinGW also needs this for using _wstat64 #define stat _stat64 #define fstat _fstat64 -#define fileno _fileno + #else #ifdef __APPLE__ #include