From 9198fbd1fccaf75b98d4a66ef26ea632eb230d55 Mon Sep 17 00:00:00 2001 From: Krisztian Litkey Date: Sat, 18 Jan 2020 13:53:44 +0200 Subject: [PATCH] common: fix compilation breakage with json-c >= 0.13.0. --- src/common/json.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/common/json.h b/src/common/json.h index 746a6ef2..90b7f80f 100644 --- a/src/common/json.h +++ b/src/common/json.h @@ -35,16 +35,22 @@ #include "murphy/config.h" +#define JSONC_VERSION(maj, min, mic) (((maj) << 16) | ((min) << 8) | (mic)) +#define JSONC_013 JSONC_VERSION(0, 13, 0) #ifndef JSON_INCLUDE_PATH_JSONC # include # include /* workaround for older broken json-c not exposing json_object_iter */ -# include +# if !defined(JSON_C_VERSION_NUM) || JSON_C_VERSION_NUM < JSONC_013 +# include +# endif #else # include # include /* workaround for older broken json-c not exposing json_object_iter */ -# include +# if !defined(JSON_C_VERSION_NUM) || JSON_C_VERSION_NUM < JSONC_013 +# include +# endif #endif #include