From 0c98dd02beddc2cba8268d207b67634092659f72 Mon Sep 17 00:00:00 2001 From: Daniel Richman Date: Fri, 24 Aug 2012 18:49:21 +0100 Subject: [PATCH] Support jsoncpp0.5 as well as 0.6 --- src/Uploader.cxx | 4 ++++ tests/test_rfc3339_main.cxx | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/Uploader.cxx b/src/Uploader.cxx index 081b908..8d00f8a 100644 --- a/src/Uploader.cxx +++ b/src/Uploader.cxx @@ -254,7 +254,11 @@ vector *Uploader::flights() map options; Json::Value startkey(Json::arrayValue); +#ifdef JSON_HAS_INT64 startkey.append((Json::Int64) time(NULL)); +#else + startkey.append((Json::Int) time(NULL)); +#endif options["include_docs"] = "true"; options["startkey"] = CouchDB::Database::json_query_value(startkey); diff --git a/tests/test_rfc3339_main.cxx b/tests/test_rfc3339_main.cxx index 23af1cf..f493202 100644 --- a/tests/test_rfc3339_main.cxx +++ b/tests/test_rfc3339_main.cxx @@ -58,7 +58,11 @@ void handle_command(const Json::Value &command) } else { +#ifdef JSON_HAS_INT64 int_arg = command[1u].asLargestInt(); +#else + int_arg = command[1u].asInt(); +#endif } try