From dcf3e0776e1f6c4af5ca283a452d8d05420f7f89 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Sat, 25 Apr 2015 23:10:39 +0300 Subject: [PATCH] Compilation fix --- Utilities/File.cpp | 14 +++++++------- Utilities/File.h | 6 ++---- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/Utilities/File.cpp b/Utilities/File.cpp index 4df82d115d..d0782fe4a2 100644 --- a/Utilities/File.cpp +++ b/Utilities/File.cpp @@ -599,7 +599,7 @@ fs::dir::~dir() #ifdef _WIN32 FindClose((HANDLE)m_dd); #else - ::closedir(m_dd); + ::closedir((DIR*)m_dd); #endif } } @@ -611,7 +611,7 @@ void fs::dir::import(handle_type dd, const std::string& path) #ifdef _WIN32 FindClose((HANDLE)m_dd); #else - ::closedir(m_dd); + ::closedir((DIR*)m_dd); #endif } @@ -632,7 +632,7 @@ bool fs::dir::open(const std::string& dirname) #ifdef _WIN32 FindClose((HANDLE)m_dd); #else - ::closedir(m_dd); + ::closedir((DIR*)m_dd); #endif } @@ -678,7 +678,7 @@ bool fs::dir::close() #ifdef _WIN32 return FindClose((HANDLE)dd); #else - return !::closedir(dd); + return !::closedir((DIR*)dd); #endif } @@ -689,7 +689,7 @@ bool fs::dir::get_first(std::string& name, stat_t& info) #ifdef _WIN32 FindClose((HANDLE)m_dd); #else - ::closedir(m_dd); + ::closedir((DIR*)m_dd); #endif } @@ -735,10 +735,10 @@ bool fs::dir::get_next(std::string& name, stat_t& info) info.mtime = to_time_t(found.ftLastWriteTime); info.ctime = to_time_t(found.ftCreationTime); #else - const auto found = ::readdir(m_dd); + const auto found = ::readdir((DIR*)m_dd); 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; } diff --git a/Utilities/File.h b/Utilities/File.h index ccaafce786..05e08e76f3 100644 --- a/Utilities/File.h +++ b/Utilities/File.h @@ -17,8 +17,6 @@ enum file_open_mode : u32 o_excl = 1 << 5, }; -struct DIR; - namespace fs { struct stat_t @@ -87,10 +85,10 @@ namespace fs static const handle_type null = -1; #else - using handle_type = DIR*; + using handle_type = intptr_t; using name_type = std::unique_ptr; - static const auto null = NULL; + static const handle_type null = 0; #endif private: