From eee1553288c1c6cab239955269fa59e1965178a4 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Tue, 31 Oct 2017 09:20:47 +0100 Subject: [PATCH] devices/ovs/ovsdb: fix build with old Jansson --- src/devices/ovs/nm-ovsdb.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/devices/ovs/nm-ovsdb.c b/src/devices/ovs/nm-ovsdb.c index 28f44f287b..9ebee53895 100644 --- a/src/devices/ovs/nm-ovsdb.c +++ b/src/devices/ovs/nm-ovsdb.c @@ -35,6 +35,14 @@ #define json_boolean(val) ((val) ? json_true() : json_false()) #endif +/* Added in Jansson v2.5 (released Sep 19 2013), but travis.ci has v2.2. */ +#ifndef json_array_foreach +#define json_array_foreach(array, index, value) \ + for (index = 0; \ + index < json_array_size(array) && (value = json_array_get(array, index)); \ + index++) +#endif + /*****************************************************************************/ typedef struct {