Skip to content

Commit

Permalink
(Releng) Attempt cross-platform fix. (previous solution was breaking …
Browse files Browse the repository at this point in the history
…build everywhere but on MacOS)
  • Loading branch information
kdesnos committed Feb 26, 2021
1 parent 2f56dd0 commit da8e8b1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
11 changes: 8 additions & 3 deletions lib/JsonCpp/json.h
Original file line number Diff line number Diff line change
Expand Up @@ -839,11 +839,16 @@ class JSON_API Value {
*/
Value(ValueType type = nullValue);
Value(Int value);
Value(UInt value);
Value(size_t value);

// Portable support for uint, uint64_t, size_t
template <typename T>
Value(T value) {
initBasic(uintValue);
value_.uint_ = value;
}

#if defined(JSON_HAS_INT64)
Value(Int64 value);
Value(UInt64 value);
#endif // if defined(JSON_HAS_INT64)
Value(double value);
Value(const char* value); ///< Copy til first 0. (NULL causes to seg-fault.)
Expand Down
14 changes: 0 additions & 14 deletions lib/JsonCpp/jsoncpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2789,25 +2789,11 @@ Value::Value(Int value) {
value_.int_ = value;
}

Value::Value(UInt value) {
initBasic(uintValue);
value_.uint_ = value;
}

Value::Value(size_t value)
{
initBasic(uintValue);
value_.uint_ = value;
}
#if defined(JSON_HAS_INT64)
Value::Value(Int64 value) {
initBasic(intValue);
value_.int_ = value;
}
Value::Value(UInt64 value) {
initBasic(uintValue);
value_.uint_ = value;
}
#endif // defined(JSON_HAS_INT64)

Value::Value(double value) {
Expand Down

0 comments on commit da8e8b1

Please sign in to comment.