Skip to content

Commit 1ec32e2

Browse files
author
Daniel Marjamäki
committed
Borland: Fixed compiler errors
1 parent d5883ef commit 1ec32e2

4 files changed

Lines changed: 14 additions & 1 deletion

File tree

cli/filelister.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,14 @@ static HANDLE MyFindFirstFile(std::string path, LPWIN32_FIND_DATA findData)
135135

136136
static BOOL MyFileExists(std::string path)
137137
{
138+
#ifdef __BORLANDC__
139+
DWORD fa = GetFileAttributes(path.c_str());
140+
BOOL result = FALSE;
141+
if (fa != INVALID_FILE_ATTRIBUTES && !(fa & FILE_ATTRIBUTE_DIRECTORY))
142+
result = TRUE;
143+
#else
138144
BOOL result = PathFileExists(path.c_str());
145+
#endif
139146
return result;
140147
}
141148

cli/pathmatch.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
*/
1818

1919
#include <algorithm>
20+
#include <ctype.h> // Borland: tolower
2021
#include "pathmatch.h"
2122

2223
PathMatch::PathMatch(const std::vector<std::string> &masks)

lib/preprocessor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ static bool isFallThroughComment(std::string comment)
288288
// convert comment to lower case without whitespace
289289
std::transform(comment.begin(), comment.end(), comment.begin(), tolowerWrapper);
290290
for (std::string::iterator i = comment.begin(); i != comment.end();) {
291-
if (::isspace(static_cast<unsigned char>(*i)))
291+
if (std::isspace(static_cast<unsigned char>(*i)))
292292
i = comment.erase(i);
293293
else
294294
++i;

lib/symboldatabase.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@
3333
#include <algorithm>
3434
#include <climits>
3535

36+
// Define ULLONG_MAX and LLONG_MAX for Borland
37+
#ifdef __BORLANDC__
38+
#define ULLONG_MAX ULONG_MAX
39+
#define LLONG_MAX LONG_MAX
40+
#endif
3641

3742
//---------------------------------------------------------------------------
3843

0 commit comments

Comments
 (0)