From ed18d79b971e4473c914df54f61b853946364c97 Mon Sep 17 00:00:00 2001 From: lifegpc Date: Fri, 17 Dec 2021 10:15:21 +0800 Subject: [PATCH] Add workround to _wstat64 is not works on MingW GCC --- fileop.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fileop.cpp b/fileop.cpp index b111d62..f656430 100644 --- a/fileop.cpp +++ b/fileop.cpp @@ -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;