Skip to content

Commit

Permalink
address compilation probs for C++ Builder
Browse files Browse the repository at this point in the history
BORLANDC compiler strangeness. Thanks to:

* Dan Liu
* Victor Chen

close open-source-parsers#269
close open-source-parsers#252
  • Loading branch information
cdunn2001 committed Apr 28, 2015
2 parents 28d086e + 6649009 commit 5256551
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
9 changes: 6 additions & 3 deletions include/json/value.h
Original file line number Diff line number Diff line change
Expand Up @@ -653,9 +653,6 @@ class JSON_API ValueIteratorBase {
typedef int difference_type;
typedef ValueIteratorBase SelfType;

ValueIteratorBase();
explicit ValueIteratorBase(const Value::ObjectValues::iterator& current);

bool operator==(const SelfType& other) const { return isEqual(other); }

bool operator!=(const SelfType& other) const { return !isEqual(other); }
Expand Down Expand Up @@ -703,6 +700,12 @@ class JSON_API ValueIteratorBase {
Value::ObjectValues::iterator current_;
// Indicates that iterator is for a null value.
bool isNull_;

public:
// For some reason, BORLAND needs these at the end, rather
// than earlier. No idea why.
ValueIteratorBase();
explicit ValueIteratorBase(const Value::ObjectValues::iterator& current);
};

/** \brief const iterator for object and array value.
Expand Down
6 changes: 6 additions & 0 deletions src/lib_json/json_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@
#define snprintf std::snprintf
#endif

#if defined(__BORLANDC__)
#include <float.h>
#define isfinite _finite
#define snprintf _snprintf
#endif

#if defined(_MSC_VER) && _MSC_VER >= 1400 // VC++ 8.0
// Disable warning about strdup being deprecated.
#pragma warning(disable : 4996)
Expand Down

0 comments on commit 5256551

Please sign in to comment.