Add workround to _wstat64 is not works on MingW GCC

This commit is contained in:
2021-12-17 10:15:21 +08:00
parent d8c4f35430
commit ed18d79b97

View File

@@ -59,8 +59,13 @@ int open_internal(wchar_t* fn, int* fd, int oflag, int shflag, int pmode) {
}
bool isdir_internal(wchar_t* fn, bool& result) {
#if __MINGW32__
struct _stat stats;
if (_wstat(fn, &stats)) {
#else
struct __stat64 stats;
if (_wstat64(fn, &stats)) {
#endif
return false;
}
result = stats.st_mode & S_IFDIR;