summaryrefslogtreecommitdiffstats
path: root/libnetdata/json/json.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-08-12 07:26:11 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-08-12 07:26:11 +0000
commit3c315f0fff93aa072472abc10815963ac0035268 (patch)
treea95f6a96e0e7bd139c010f8dc60b40e5b3062a99 /libnetdata/json/json.h
parentAdding upstream version 1.35.1. (diff)
downloadnetdata-3c315f0fff93aa072472abc10815963ac0035268.tar.xz
netdata-3c315f0fff93aa072472abc10815963ac0035268.zip
Adding upstream version 1.36.0.upstream/1.36.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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 79b58b170..b43f06b50 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;