Refactor #5580: Fix Win32 compile issue

This commit is contained in:
pandamicro 2014-06-23 11:13:33 +08:00
parent d90116a8da
commit ee82e9aaba
1 changed files with 4 additions and 3 deletions

View File

@ -947,8 +947,9 @@ bool FileUtils::isDirectoryExist(const std::string& dirPath)
return false;
#else
if ((GetFileAttributesA(path.c_str())) != INVALID_FILE_ATTRIBUTES &&
(dwAttrib & FILE_ATTRIBUTE_DIRECTORY))
unsigned long fAttrib = GetFileAttributesA(dirPath.c_str());
if (fAttrib != INVALID_FILE_ATTRIBUTES &&
(fAttrib & FILE_ATTRIBUTE_DIRECTORY))
{
return true;
}
@ -970,7 +971,7 @@ bool FileUtils::createDirectory(const std::string& dirPath)
}
return true;
#else
if ((GetFileAttributesA(path.c_str())) == INVALID_FILE_ATTRIBUTES)
if (GetFileAttributesA(dirPath.c_str()) == INVALID_FILE_ATTRIBUTES)
{
BOOL ret = CreateDirectoryA(dirPath.c_str(), NULL);
if (!ret && ERROR_ALREADY_EXISTS != GetLastError())