From 873d76e7f9b4a803c92dc44bc92ef5565e74ca8e Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 20 Oct 2016 21:20:15 -0400 Subject: [PATCH] lib: Fix for int64 and json on some systems When compiling json on systems with json/json.h that don't have json_object_new_int64, just use json_object_new_int instead and accept we might truncate data. Signed-off-by: Donald Sharp --- lib/json.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/json.c b/lib/json.c index ca30c60984..c49a4f9074 100644 --- a/lib/json.c +++ b/lib/json.c @@ -56,7 +56,11 @@ json_object_int_add(struct json_object* obj, const char *key, int32_t i) void json_object_long_add(struct json_object* obj, const char *key, int64_t i) { +#if defined(HAVE_JSON_C_JSON_H) json_object_object_add(obj, key, json_object_new_int64(i)); +#else + json_object_object_add(obj, key, json_object_new_int((int)i)); +#endif } void -- 2.39.5