mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-06-15 14:55:30 +00:00
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:
parent
ce01a2ca3f
commit
873d76e7f9
@ -56,7 +56,11 @@ json_object_int_add(struct json_object* obj, const char *key, int32_t i)
|
|||||||
void
|
void
|
||||||
json_object_long_add(struct json_object* obj, const char *key, int64_t i)
|
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));
|
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
|
void
|
||||||
|
Loading…
Reference in New Issue
Block a user