Adaptions for API change in json-c v0.13

This commit is contained in:
Björn Esser 2017-12-14 17:14:47 +01:00
parent 8272a9bae0
commit 02da9c4e7c
No known key found for this signature in database
GPG key ID: F52E98007594C21D
7 changed files with 29 additions and 15 deletions

View file

@ -0,0 +1,16 @@
#ifndef _SWAY_JSON_HELPER_H
#define _SWAY_JSON_HELPER_H
#include <json-c/json.h>
// Macros for checking a specific version.
#define JSON_C_VERSION_013 (13 << 8)
// json-c v0.13 uses size_t for array_list_length().
#if defined(JSON_C_VERSION_NUM) && JSON_C_VERSION_NUM >= JSON_C_VERSION_013
typedef size_t json_ar_len_t;
#else
typedef int json_ar_len_t;
#endif
#endif // _SWAY_JSON_HELPER_H