From 48381d0d603e82653e6dc61feb02068d7fc79bd8 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Fri, 17 May 2024 12:43:02 +0200 Subject: [PATCH] [winpr,utils] add json-c compat for old json-c releases < 0.14.0 add a json_object_new_null replacement --- winpr/libwinpr/utils/json/json.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/winpr/libwinpr/utils/json/json.c b/winpr/libwinpr/utils/json/json.c index 4c84812c4..73c064531 100644 --- a/winpr/libwinpr/utils/json/json.c +++ b/winpr/libwinpr/utils/json/json.c @@ -39,6 +39,17 @@ #endif #endif +#if defined(WITH_JSONC) +#if JSON_C_MAJOR_VERSION == 0 +#if JSON_C_MINOR_VERSION < 14 +static struct json_object* json_object_new_null(void) +{ + return NULL; +} +#endif +#endif +#endif + #if defined(USE_CJSON_COMPAT) static double cJSON_GetNumberValue(const cJSON* const prop) {