Borland: Fixed compiler errors

This commit is contained in:
Daniel Marjamäki 2011-10-16 07:52:54 +02:00
parent d5883ef0c4
commit 1ec32e27db
4 changed files with 14 additions and 1 deletions

View File

@ -135,7 +135,14 @@ static HANDLE MyFindFirstFile(std::string path, LPWIN32_FIND_DATA findData)
static BOOL MyFileExists(std::string path)
{
#ifdef __BORLANDC__
DWORD fa = GetFileAttributes(path.c_str());
BOOL result = FALSE;
if (fa != INVALID_FILE_ATTRIBUTES && !(fa & FILE_ATTRIBUTE_DIRECTORY))
result = TRUE;
#else
BOOL result = PathFileExists(path.c_str());
#endif
return result;
}

View File

@ -17,6 +17,7 @@
*/
#include <algorithm>
#include <ctype.h> // Borland: tolower
#include "pathmatch.h"
PathMatch::PathMatch(const std::vector<std::string> &masks)

View File

@ -288,7 +288,7 @@ static bool isFallThroughComment(std::string comment)
// convert comment to lower case without whitespace
std::transform(comment.begin(), comment.end(), comment.begin(), tolowerWrapper);
for (std::string::iterator i = comment.begin(); i != comment.end();) {
if (::isspace(static_cast<unsigned char>(*i)))
if (std::isspace(static_cast<unsigned char>(*i)))
i = comment.erase(i);
else
++i;

View File

@ -33,6 +33,11 @@
#include <algorithm>
#include <climits>
// Define ULLONG_MAX and LLONG_MAX for Borland
#ifdef __BORLANDC__
#define ULLONG_MAX ULONG_MAX
#define LLONG_MAX LONG_MAX
#endif
//---------------------------------------------------------------------------