summaryrefslogtreecommitdiffstats
path: root/libnetdata/json/json.h
diff options
context:
space:
mode:
Diffstat (limited to 'libnetdata/json/json.h')
-rw-r--r--libnetdata/json/json.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/libnetdata/json/json.h b/libnetdata/json/json.h
index 79b58b17..b43f06b5 100644
--- a/libnetdata/json/json.h
+++ b/libnetdata/json/json.h
@@ -3,8 +3,13 @@
#if ENABLE_JSONC
-# include <json-c/json.h>
-#endif
+#include <json-c/json.h>
+// fix an older json-c bug
+// https://github.com/json-c/json-c/issues/135
+#ifdef error_description
+#undef error_description
+#endif // error_description
+#endif // ENABLE_JSONC
#include "jsmn.h"
@@ -26,12 +31,12 @@ typedef struct json_entry {
char name[JSON_NAME_LEN + 1];
char fullname[JSON_FULLNAME_LEN + 1];
union {
- char *string; // type == JSON_STRING
- long double number; // type == JSON_NUMBER
- int boolean; // type == JSON_BOOLEAN
- size_t items; // type == JSON_ARRAY
+ char *string; // type == JSON_STRING
+ NETDATA_DOUBLE number; // type == JSON_NUMBER
+ int boolean; // type == JSON_BOOLEAN
+ size_t items; // type == JSON_ARRAY
} data;
- size_t pos; // the position of this item in its parent
+ size_t pos; // the position of this item in its parent
char *original_string;