diff --git a/metamod/src/mplugin.cpp b/metamod/src/mplugin.cpp index b6541c4..4c04335 100644 --- a/metamod/src/mplugin.cpp +++ b/metamod/src/mplugin.cpp @@ -1088,9 +1088,9 @@ void MPlugin::show() // last loaded the plugin. bool MPlugin::newer_file() const { - struct stat st; + struct stat64 st; - if (stat(m_pathname, &st) != 0) { + if (stat64(m_pathname, &st) != 0) { META_ERROR("ini: Skipping plugin, couldn't stat file '%s': %s", m_pathname, strerror(errno)); return false; } diff --git a/metamod/src/osdep.h b/metamod/src/osdep.h index 5ac0021..bcd15f5 100644 --- a/metamod/src/osdep.h +++ b/metamod/src/osdep.h @@ -73,6 +73,7 @@ private: #elif defined(_WIN32) #define snprintf _snprintf #define vsnprintf _vsnprintf + #define stat64 _stat64 #define sleep(x) Sleep(x*1000) #include #define open _open diff --git a/metamod/src/utils.cpp b/metamod/src/utils.cpp index cc96a90..42d744c 100644 --- a/metamod/src/utils.cpp +++ b/metamod/src/utils.cpp @@ -171,8 +171,8 @@ bool is_abs_path(const char* path) bool is_valid_path(const char* path) { - struct stat st; - return !stat(path, &st) && S_ISREG(st.st_mode); + struct stat64 st; + return !stat64(path, &st) && S_ISREG(st.st_mode); } bool is_platform_postfix(const char* pf) @@ -242,8 +242,8 @@ bool is_file_exists_in_gamedir(const char* path) else snprintf(buf, sizeof buf, "%s/%s", g_GameDLL.gamedir, path); - struct stat st; - int ret = stat(buf, &st); + struct stat64 st; + int ret = stat64(buf, &st); if (ret != 0) { META_DEBUG(5, "Unable to stat '%s': %s", buf, strerror(errno)); return false;