Skip to content

Commit 5256551

Browse files
committed
address compilation probs for C++ Builder
BORLANDC compiler strangeness. Thanks to: * Dan Liu * Victor Chen close #269 close #252
2 parents 28d086e + 6649009 commit 5256551

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

include/json/value.h

+6-3
Original file line numberDiff line numberDiff line change
@@ -653,9 +653,6 @@ class JSON_API ValueIteratorBase {
653653
typedef int difference_type;
654654
typedef ValueIteratorBase SelfType;
655655

656-
ValueIteratorBase();
657-
explicit ValueIteratorBase(const Value::ObjectValues::iterator& current);
658-
659656
bool operator==(const SelfType& other) const { return isEqual(other); }
660657

661658
bool operator!=(const SelfType& other) const { return !isEqual(other); }
@@ -703,6 +700,12 @@ class JSON_API ValueIteratorBase {
703700
Value::ObjectValues::iterator current_;
704701
// Indicates that iterator is for a null value.
705702
bool isNull_;
703+
704+
public:
705+
// For some reason, BORLAND needs these at the end, rather
706+
// than earlier. No idea why.
707+
ValueIteratorBase();
708+
explicit ValueIteratorBase(const Value::ObjectValues::iterator& current);
706709
};
707710

708711
/** \brief const iterator for object and array value.

src/lib_json/json_writer.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@
3333
#define snprintf std::snprintf
3434
#endif
3535

36+
#if defined(__BORLANDC__)
37+
#include <float.h>
38+
#define isfinite _finite
39+
#define snprintf _snprintf
40+
#endif
41+
3642
#if defined(_MSC_VER) && _MSC_VER >= 1400 // VC++ 8.0
3743
// Disable warning about strdup being deprecated.
3844
#pragma warning(disable : 4996)

0 commit comments

Comments
 (0)