X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Futils_format_json_test.c;h=d13c932f40de59f894c4c2715306b395c3c7e8bd;hb=1961988253c1f5b29a52343a34d291929e84fcf1;hp=353ef01c36f707e89e2436674201b71acae478f4;hpb=7e62a541e0b9944da9207e702c61871d58af2171;p=collectd.git diff --git a/src/utils_format_json_test.c b/src/utils_format_json_test.c index 353ef01c..d13c932f 100644 --- a/src/utils_format_json_test.c +++ b/src/utils_format_json_test.c @@ -24,8 +24,21 @@ * Florian octo Forster */ -#include "testing.h" +/* Workaround for Solaris 10 defining label_t + * Issue #1301 + */ + +#include "config.h" +#if KERNEL_SOLARIS +# ifndef _POSIX_C_SOURCE +# define _POSIX_C_SOURCE 200112L +# endif +# undef __EXTENSIONS__ +#endif + #include "collectd.h" + +#include "testing.h" #include "utils_format_json.h" #include "common.h" /* for STATIC_ARRAY_SIZE */ @@ -34,25 +47,23 @@ #if HAVE_YAJL_YAJL_VERSION_H # include #endif -#if defined(YAJL_MAJOR) && (YAJL_MAJOR > 1) +#if YAJL_MAJOR > 1 # define HAVE_YAJL_V2 1 #endif -struct label_s +typedef struct { - char *key; - char *value; -}; -typedef struct label_s label_t; + char const *key; + char const *value; +} label_t; -struct test_case_s +typedef struct { label_t *expected_labels; size_t expected_labels_num; label_t *current_label; -}; -typedef struct test_case_s test_case_t; +} test_case_t; #if HAVE_YAJL_V2 static int test_map_key (void *ctx, unsigned char const *key, size_t key_len)