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 <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2016-10-20 21:20:15 -04:00
parent ce01a2ca3f
commit 873d76e7f9

View File

@ -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