]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
future yjail
authorWilfried Goesgens <willi@arangodb.com>
Tue, 3 Mar 2020 12:33:47 +0000 (13:33 +0100)
committerWilfried Goesgens <willi@arangodb.com>
Tue, 3 Mar 2020 13:05:15 +0000 (14:05 +0100)
src/curl_jolokia.c

index e0c4e3614f16d2ca3efe6c966e0f01b28fa78494..72867fe4cc0246409bfe872d81b089700bfa070e 100644 (file)
 #include <curl/curl.h>
 
 #include <yajl/yajl_parse.h>
+#if HAVE_YAJL_YAJL_VERSION_H
+#include <yajl/yajl_version.h>
+#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;