fixed win32-x-ubuntu compilation

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1590 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2009-09-03 20:51:12 +00:00
parent be59ccf135
commit 82f33acf6f

View File

@ -392,7 +392,13 @@ bool RsDirUtil::renameFile(const std::string& from, const std::string& to)
int loops = 0; int loops = 0;
#if defined(WIN32) || defined(MINGW) || defined(__CYGWIN__) #if defined(WIN32) || defined(MINGW) || defined(__CYGWIN__)
#ifdef WIN_CROSS_UBUNTU
std::wstring f,t ;
for(int i=0;i<from.size();++i) f.push_back(from[i]) ;
for(int i=0;i<to.size();++i) t.push_back(to[i]) ;
#else
std::string f(from),t(to) ; std::string f(from),t(to) ;
#endif
while (!MoveFileEx(f.c_str(), t.c_str(), MOVEFILE_REPLACE_EXISTING)) while (!MoveFileEx(f.c_str(), t.c_str(), MOVEFILE_REPLACE_EXISTING))
#else #else
while (rename(from.c_str(), to.c_str()) < 0) while (rename(from.c_str(), to.c_str()) < 0)