mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
JsonCPP: restore '1.0.0+' compatibility (#15368)
Previously, compiling on Ubuntu 20.04 would fail with the system-provided JsonCPP version (1.7.4). Which would satisfy the documented requirement of "1.0.0+".
This commit is contained in:
parent
3064f3ccb7
commit
c884e7181f
3 changed files with 10 additions and 11 deletions
|
@ -13,10 +13,17 @@
|
|||
#include <array>
|
||||
#include <optional>
|
||||
#include <limits>
|
||||
#include <memory> // unique_ptr
|
||||
#include <stdexcept>
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
|
||||
#if JSONCPP_VERSION_HEXA < 0x01090000 /* 1.9.0 */
|
||||
namespace Json {
|
||||
using String = JSONCPP_STRING; // Polyfill
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace tiniergltf {
|
||||
|
||||
static inline void check(bool cond) {
|
||||
|
@ -1381,7 +1388,7 @@ static Json::Value readJson(Span<const char> span) {
|
|||
Json::CharReaderBuilder builder;
|
||||
const std::unique_ptr<Json::CharReader> reader(builder.newCharReader());
|
||||
Json::Value json;
|
||||
JSONCPP_STRING err;
|
||||
Json::String err;
|
||||
if (!reader->parse(span.ptr, span.end(), &json, &err))
|
||||
throw std::runtime_error(std::string("invalid JSON: ") + err);
|
||||
return json;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue