diff --git a/include/athena/Dir.hpp b/include/athena/Dir.hpp index a95e57c..8637af2 100644 --- a/include/athena/Dir.hpp +++ b/include/athena/Dir.hpp @@ -2,7 +2,7 @@ #include -#if _WIN32 +#if _WIN32 && !defined(__MINGW32__) using mode_t = int; #else #include diff --git a/src/athena/FileInfo.cpp b/src/athena/FileInfo.cpp index f017ed2..79abb52 100644 --- a/src/athena/FileInfo.cpp +++ b/src/athena/FileInfo.cpp @@ -9,7 +9,7 @@ #include "athena/FileWriter.hpp" #include "athena/Utility.hpp" -#ifndef _WIN32 +#if !defined(_WIN32) || defined(__MINGW32__) #include #include #include @@ -25,7 +25,7 @@ #include #endif -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__MINGW32__) #include #include #define realpath(__name, __resolved) _fullpath((__resolved), (__name), 4096) @@ -78,16 +78,24 @@ bool FileInfo::exists() const { if (e < 0) return false; - return (S_ISREG(st.st_mode) || S_ISLNK(st.st_mode)); + return (S_ISREG(st.st_mode) +#ifndef _WIN32 + || S_ISLNK(st.st_mode) +#endif + ); } bool FileInfo::isLink() const { +#ifndef _WIN32 atStat64_t st; int e = atStat64(m_path.c_str(), &st); if (e < 0) return false; return (S_ISLNK(st.st_mode)); +#else + return false; +#endif } bool FileInfo::isFile() const { @@ -100,7 +108,7 @@ bool FileInfo::isFile() const { } bool FileInfo::touch() const { -#if defined(__GNUC__) && !(defined(HW_DOL) || defined(HW_RVL) || defined(GEKKO)) +#if defined(__GNUC__) && !(defined(HW_DOL) || defined(HW_RVL) || defined(GEKKO)) && !defined(__MINGW32__) atStat64_t st; if (atStat64(m_path.c_str(), &st) < 0) { (void)athena::io::FileWriter(m_path);