1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-06-08 01:22:02 +00:00

fix linux build for good

This commit is contained in:
fgenesis 2025-03-05 01:04:02 +01:00
parent db2f6c85d9
commit e960000aa6

View file

@ -356,7 +356,7 @@ static bool _unixIsDirectory(const std::string& base, const char *name)
full += '/'; full += '/';
full += name; full += name;
struct stat st; struct stat st;
int err = ::stat(full.c_str(), &st, 0); int err = ::stat(full.c_str(), &st);
if(err == -1) if(err == -1)
return false; return false;
return S_ISDIR(st.st_mode); return S_ISDIR(st.st_mode);
@ -365,7 +365,7 @@ static bool _unixIsDirectory(const std::string& base, const char *name)
template<bool has_d_type> template<bool has_d_type>
struct Unix_IsDir struct Unix_IsDir
{ {
inline static bool Get(const std::string& base struct dirent *dp) inline static bool Get(const std::string& base, struct dirent *dp)
{ {
return _unixIsDirectory(base, dp->d_name); return _unixIsDirectory(base, dp->d_name);
} }
@ -389,9 +389,9 @@ struct Unix_IsDir<true>
} }
}; };
static inline tio_FileType unixIsDirectory(const std::string& base, struct dirent *dp) static inline bool unixIsDirectory(const std::string& base, struct dirent *dp)
{ {
return Unix_IsDir<Has_d_type<dirent>::value>::Get(pathfd, dp); return Unix_IsDir<Has_d_type<dirent>::value>::Get(base, dp);
} }
// skip if "." or ".." // skip if "." or ".."
@ -439,7 +439,7 @@ void forEachDir(const std::string& inpath, FileIterationCallback callback, void
{ {
if(!dirlistSkip(dp->d_name)) if(!dirlistSkip(dp->d_name))
if(unixIsDirectory(inpath, dp)) if(unixIsDirectory(inpath, dp))
callback(path + std::string(file->d_name), param); callback(path + std::string(dp->d_name), param);
} }
closedir(dir); closedir(dir);
} }