Compilation fix

This commit is contained in:
Nekotekina 2015-04-25 23:10:39 +03:00
parent 02ca97804e
commit dcf3e0776e
2 changed files with 9 additions and 11 deletions

View File

@ -599,7 +599,7 @@ fs::dir::~dir()
#ifdef _WIN32 #ifdef _WIN32
FindClose((HANDLE)m_dd); FindClose((HANDLE)m_dd);
#else #else
::closedir(m_dd); ::closedir((DIR*)m_dd);
#endif #endif
} }
} }
@ -611,7 +611,7 @@ void fs::dir::import(handle_type dd, const std::string& path)
#ifdef _WIN32 #ifdef _WIN32
FindClose((HANDLE)m_dd); FindClose((HANDLE)m_dd);
#else #else
::closedir(m_dd); ::closedir((DIR*)m_dd);
#endif #endif
} }
@ -632,7 +632,7 @@ bool fs::dir::open(const std::string& dirname)
#ifdef _WIN32 #ifdef _WIN32
FindClose((HANDLE)m_dd); FindClose((HANDLE)m_dd);
#else #else
::closedir(m_dd); ::closedir((DIR*)m_dd);
#endif #endif
} }
@ -678,7 +678,7 @@ bool fs::dir::close()
#ifdef _WIN32 #ifdef _WIN32
return FindClose((HANDLE)dd); return FindClose((HANDLE)dd);
#else #else
return !::closedir(dd); return !::closedir((DIR*)dd);
#endif #endif
} }
@ -689,7 +689,7 @@ bool fs::dir::get_first(std::string& name, stat_t& info)
#ifdef _WIN32 #ifdef _WIN32
FindClose((HANDLE)m_dd); FindClose((HANDLE)m_dd);
#else #else
::closedir(m_dd); ::closedir((DIR*)m_dd);
#endif #endif
} }
@ -735,10 +735,10 @@ bool fs::dir::get_next(std::string& name, stat_t& info)
info.mtime = to_time_t(found.ftLastWriteTime); info.mtime = to_time_t(found.ftLastWriteTime);
info.ctime = to_time_t(found.ftCreationTime); info.ctime = to_time_t(found.ftCreationTime);
#else #else
const auto found = ::readdir(m_dd); const auto found = ::readdir((DIR*)m_dd);
struct stat64 file_info; struct stat64 file_info;
if (fstatat64(::dirfd(m_dd), found.d_name, &file_info, 0) < 0) if (fstatat64(::dirfd((DIR*)m_dd), found.d_name, &file_info, 0) < 0)
{ {
return false; return false;
} }

View File

@ -17,8 +17,6 @@ enum file_open_mode : u32
o_excl = 1 << 5, o_excl = 1 << 5,
}; };
struct DIR;
namespace fs namespace fs
{ {
struct stat_t struct stat_t
@ -87,10 +85,10 @@ namespace fs
static const handle_type null = -1; static const handle_type null = -1;
#else #else
using handle_type = DIR*; using handle_type = intptr_t;
using name_type = std::unique_ptr<char[]>; using name_type = std::unique_ptr<char[]>;
static const auto null = NULL; static const handle_type null = 0;
#endif #endif
private: private: