This is a patch for the previous patch *facepalms*

I got confused somehow between the different versions of my modifications and Linux/Windows, anyway it should work now.


git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2925 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
leander-256 2010-05-16 23:59:39 +00:00
parent b30056e17f
commit 913789b972
3 changed files with 13 additions and 3 deletions

View File

@ -41,7 +41,8 @@ bool FolderIterator::readdir() {
}
return FindNextFileW(handle, &fileInfo) != 0;
#else
return readdir(handle) == 0;
ent = ::readdir(handle);
return ent != 0;
#endif
}
@ -56,7 +57,9 @@ bool FolderIterator::d_name(std::string& dest)
return false;
}
#else
dest = handle->d_name;
if(ent == 0)
return false;
dest = ent->d_name;
#endif
return true;
@ -72,7 +75,7 @@ bool FolderIterator::closedir()
#ifdef WINDOWS_SYS
return FindClose(handle) != 0;
#else
return closedir(handle) == 0;
return ::closedir(handle) == 0;
#endif
}

View File

@ -42,6 +42,7 @@ private:
_WIN32_FIND_DATAW fileInfo;
#else
DIR* handle;
struct dirent* ent;
#endif
};

View File

@ -1,6 +1,9 @@
#include "util/rswin.h"
#ifdef WINDOWS_SYS
namespace librs { namespace util {
@ -47,3 +50,6 @@ bool ConvertUtf16ToUtf8(const std::wstring& source, std::string& dest) {
} } // librs::util
#endif // WINDOWS_SYS