From: Wilfried Goesgens Date: Tue, 3 Mar 2020 12:33:47 +0000 (+0100) Subject: future yjail X-Git-Tag: collectd-5.12.0~4^2^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=55c898f7944b10f9add9733264b8ca79eb54898e;p=thirdparty%2Fcollectd.git future yjail --- diff --git a/src/curl_jolokia.c b/src/curl_jolokia.c index e0c4e3614..72867fe4c 100644 --- a/src/curl_jolokia.c +++ b/src/curl_jolokia.c @@ -37,6 +37,13 @@ #include #include +#if HAVE_YAJL_YAJL_VERSION_H +#include +#endif + +#if defined(YAJL_MAJOR) && (YAJL_MAJOR > 1) +#define HAVE_YAJL_V2 1 +#endif #define CJO_DEFAULT_HOST "localhost" @@ -131,6 +138,12 @@ struct cjo_s /* {{{ */ }; typedef struct cjo_s cjo_t; /* }}} */ +#if HAVE_YAJL_V2 +typedef size_t yajl_len_t; +#else +typedef unsigned int yajl_len_t; +#endif + static void cjo_init_buffer(cjo_membuffer_t *buf, size_t initial_size) { buf->buffer = calloc(1, initial_size); buf->used = 0;