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