From 76b913a210eaebae6722b27fa7afadd4bff62a5f Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 31 Oct 2017 20:02:48 +0100 Subject: ovs: add backward compatibility wrapper for json_object_foreach() macro --- src/devices/ovs/nm-ovsdb.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/devices/ovs/nm-ovsdb.c b/src/devices/ovs/nm-ovsdb.c index 166311a07c..b44668c0d3 100644 --- a/src/devices/ovs/nm-ovsdb.c +++ b/src/devices/ovs/nm-ovsdb.c @@ -43,6 +43,14 @@ index++) #endif +/* Added in Jansson v2.3 (released Jan 27 2012) */ +#ifndef json_object_foreach +#define json_object_foreach(object, key, value) \ + for(key = json_object_iter_key(json_object_iter(object)); \ + key && (value = json_object_iter_value(json_object_key_to_iter(key))); \ + key = json_object_iter_key(json_object_iter_next(object, json_object_key_to_iter(key)))) +#endif + /*****************************************************************************/ typedef struct { -- cgit v1.2.1