[chromecast] json-c < 0.11 compability

This commit is contained in:
ejurgensen
2016-03-06 21:33:49 +01:00
parent a2222c8a52
commit 598ae1bd71
2 changed files with 12 additions and 4 deletions

View File

@@ -35,10 +35,14 @@
#include <fcntl.h>
#include <endian.h>
#include <gnutls/gnutls.h>
#include <json-c/json.h>
#include <event2/event.h>
#ifdef HAVE_JSON_C_OLD
# include <json/json.h>
#else
# include <json-c/json.h>
#endif
#include "conffile.h"
#include "mdns.h"
#include "logger.h"
@@ -705,8 +709,12 @@ cast_msg_parse(struct cast_msg_payload *payload, char *s)
static void
cast_msg_parse_free(void *haystack)
{
#ifdef HAVE_JSON_C_OLD
json_object_put((json_object *)haystack);
#else
if (json_object_put((json_object *)haystack) != 1)
DPRINTF(E_LOG, L_CAST, "Memleak: JSON parser did not free object\n");
#endif
}
static void