aboutsummaryrefslogtreecommitdiff
path: root/src/common.h
diff options
context:
space:
mode:
authorJan200101 <sentrycraft123@gmail.com>2020-12-19 00:31:40 +0100
committerJan200101 <sentrycraft123@gmail.com>2020-12-19 00:31:40 +0100
commit79e6835eb9478680530e66e12dc365993a08b788 (patch)
tree477a96ea6f0ae70df4c1c0daa3e3dcfc3337bcc3 /src/common.h
parent24288734e78aa2242b86dde8c770278fa1f5e05c (diff)
downloadpolecat-79e6835eb9478680530e66e12dc365993a08b788.tar.gz
polecat-79e6835eb9478680530e66e12dc365993a08b788.zip
remove useless struct, add json length type macro
- previously used progress struct was a leftover from when libcurl examples were used - json_object_array_length returns int pre 0.13 and site_t on any other version
Diffstat (limited to 'src/common.h')
-rw-r--r--src/common.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/common.h b/src/common.h
index 5916b99..a77d0a2 100644
--- a/src/common.h
+++ b/src/common.h
@@ -39,6 +39,16 @@
#define UNUSED
#endif
+#include <json.h>
+
+// since json-c 0.13 json_object_array_length returns a size_t
+#if defined(JSON_C_MINOR_VERSION) && JSON_C_MINOR_VERSION >= 13
+#define JSON_LENGTH_TYPE size_t
+#else
+#define JSON_LENGTH_TYPE int
+#endif
+
+
struct MemoryStruct {
uint8_t* memory;
size_t size;