Commit 1443bf77 authored by Lubomir Rintel's avatar Lubomir Rintel 🥕

all: require jansson 2.5

It was released Sep 19 2013 and Ubuntu 14.04 LTS (trusty) ships it.

https://bugzilla.gnome.org/show_bug.cgi?id=792323
parent c4f65557
......@@ -565,7 +565,7 @@ PKG_CHECK_MODULES(UUID, uuid)
# Teamd control checks
PKG_CHECK_MODULES(JANSSON, [jansson], [have_jansson=yes], [have_jansson=no])
PKG_CHECK_MODULES(JANSSON, [jansson >= 2.5], [have_jansson=yes], [have_jansson=no])
if test "$have_jansson" = "yes"; then
AC_DEFINE(WITH_JANSSON, 1, [Define if JANSSON is enabled])
......
......@@ -182,7 +182,7 @@ libndp_dep = dependency('libndp')
# libnl support for the linux platform
libnl_dep = dependency('libnl-3.0', version: '>= 3.2.8', required: false)
jansson_dep = dependency('jansson', required: false)
jansson_dep = dependency('jansson', version: '>= 2.5', required: false)
config_h.set10('WITH_JANSSON', jansson_dep.found())
if jansson_dep.found()
......
......@@ -26,27 +26,6 @@
#include <jansson.h>
/* 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_iter_at (object, key) )); \
key = json_object_iter_key(json_object_iter_next(object, json_object_iter_at (object, key))))
#endif
/* Added in Jansson v2.4 (released Sep 23 2012), but travis.ci has v2.2. */
#ifndef json_boolean
#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
/* Added in Jansson v2.7 */
#ifndef json_boolean_value
#define json_boolean_value json_is_true
......@@ -54,14 +33,6 @@
/* Added in Jansson v2.8 */
#ifndef json_object_foreach_safe
#if JANSSON_VERSION_HEX < 0x020300
#define json_object_foreach_safe(object, n, key, value) \
for (key = json_object_iter_key (json_object_iter (object)), \
n = json_object_iter_next (object, json_object_iter_at (object, key)); \
key && (value = json_object_iter_value (json_object_iter_at (object, key))); \
key = json_object_iter_key (n), \
n = json_object_iter_next (object, json_object_iter_at (object, key)))
#else
#define json_object_foreach_safe(object, n, key, value) \
for(key = json_object_iter_key(json_object_iter(object)), \
n = json_object_iter_next(object, json_object_key_to_iter(key)); \
......@@ -69,7 +40,6 @@
key = json_object_iter_key(n), \
n = json_object_iter_next(object, json_object_key_to_iter(key)))
#endif
#endif
#endif /* WITH_JANSON */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment