summaryrefslogtreecommitdiffstats
path: root/grammar/rainerscript.c
diff options
context:
space:
mode:
Diffstat (limited to 'grammar/rainerscript.c')
-rw-r--r--grammar/rainerscript.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/grammar/rainerscript.c b/grammar/rainerscript.c
index e41efa04..abf9dd34 100644
--- a/grammar/rainerscript.c
+++ b/grammar/rainerscript.c
@@ -1192,7 +1192,11 @@ var2Number(struct var *r, int *bSuccess)
n = es_str2num(r->d.estr, bSuccess);
} else {
if(r->datatype == 'J') {
+#ifdef HAVE_JSON_OBJECT_NEW_INT64
+ n = (r->d.json == NULL) ? 0 : json_object_get_int64(r->d.json);
+#else /* HAVE_JSON_OBJECT_NEW_INT64 */
n = (r->d.json == NULL) ? 0 : json_object_get_int(r->d.json);
+#endif /* HAVE_JSON_OBJECT_NEW_INT64 */
} else {
n = r->d.n;
}