summaryrefslogtreecommitdiff
path: root/lib/json.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/json.c')
-rw-r--r--lib/json.c4
1 files changed, 4 insertions, 0 deletions
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