$OpenBSD$ From upstream 5bab6210ef2642110e27e272e23b05ff3befe383. --- Source/Core/Common/FileUtil.cpp.orig Fri Jun 24 02:09:07 2016 +++ Source/Core/Common/FileUtil.cpp Mon Jul 18 00:16:17 2016 @@ -45,11 +45,6 @@ #define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR) #endif -#if defined BSD4_4 || defined __FreeBSD__ -#define stat64 stat -#define fstat64 fstat -#endif - // This namespace has various generic functions related to files and paths. // The code still needs a ton of cleanup. // REMEMBER: strdup considered harmful! @@ -70,7 +65,7 @@ static void StripTailDirSlashes(std::string& fname) // Returns true if file filename exists bool Exists(const std::string& filename) { - struct stat64 file_info; + struct stat file_info; std::string copy(filename); StripTailDirSlashes(copy); @@ -78,7 +73,7 @@ bool Exists(const std::string& filename) #ifdef _WIN32 int result = _tstat64(UTF8ToTStr(copy).c_str(), &file_info); #else - int result = stat64(copy.c_str(), &file_info); + int result = stat(copy.c_str(), &file_info); #endif return (result == 0); @@ -87,7 +82,7 @@ bool Exists(const std::string& filename) // Returns true if filename is a directory bool IsDirectory(const std::string& filename) { - struct stat64 file_info; + struct stat file_info; std::string copy(filename); StripTailDirSlashes(copy); @@ -95,7 +90,7 @@ bool IsDirectory(const std::string& filename) #ifdef _WIN32 int result = _tstat64(UTF8ToTStr(copy).c_str(), &file_info); #else - int result = stat64(copy.c_str(), &file_info); + int result = stat(copy.c_str(), &file_info); #endif if (result < 0) @@ -386,11 +381,11 @@ u64 GetSize(const std::string& filename) return 0; } - struct stat64 buf; + struct stat buf; #ifdef _WIN32 if (_tstat64(UTF8ToTStr(filename).c_str(), &buf) == 0) #else - if (stat64(filename.c_str(), &buf) == 0) + if (stat(filename.c_str(), &buf) == 0) #endif { DEBUG_LOG(COMMON, "GetSize: %s: %lld", @@ -406,8 +401,8 @@ u64 GetSize(const std::string& filename) // Overloaded GetSize, accepts file descriptor u64 GetSize(const int fd) { - struct stat64 buf; - if (fstat64(fd, &buf) != 0) + struct stat buf; + if (fstat(fd, &buf) != 0) { ERROR_LOG(COMMON, "GetSize: stat failed %i: %s", fd, GetLastErrorMsg().c_str());