Borland C++: Fixed problem in FileLister

This commit is contained in:
danmar 2009-08-28 11:00:42 +02:00
parent 3b2744e04a
commit 465c450247
1 changed files with 2 additions and 8 deletions

View File

@ -30,9 +30,7 @@
#endif #endif
#if defined(__BORLANDC__) || defined(_MSC_VER) || defined(__MINGW32__) #if defined(__BORLANDC__) || defined(_MSC_VER) || defined(__MINGW32__)
#include <windows.h> #include <windows.h>
#ifdef __BORLANDC__ #ifndef __BORLANDC__
#include <dir.h>
#else
#include <shlwapi.h> #include <shlwapi.h>
#endif #endif
#endif #endif
@ -203,11 +201,7 @@ static HANDLE MyFindFirstFile(std::string path, LPWIN32_FIND_DATA findData)
static BOOL MyIsDirectory(std::string path) static BOOL MyIsDirectory(std::string path)
{ {
#ifdef __BORLANDC__ #ifdef __BORLANDC__
struct ffblk ffblk; return (GetFileAttributes(path.c_str()) & FILE_ATTRIBUTE_DIRECTORY);
int ret = findfirst(path.c_str(), &ffblk, FA_DIREC);
if (ret == 0)
findclose(&ffblk);
return !ret;
#else #else
// See http://msdn.microsoft.com/en-us/library/bb773621(VS.85).aspx // See http://msdn.microsoft.com/en-us/library/bb773621(VS.85).aspx
return PathIsDirectory(path.c_str()); return PathIsDirectory(path.c_str());