Fix build errors with json-c 0.12

This commit is contained in:
Thomas Wucher 2015-07-09 11:50:27 +02:00
parent 1a7fe12221
commit 8235618970
3 changed files with 4 additions and 4 deletions

View file

@ -38,7 +38,7 @@ AC_ARG_ENABLE(
AM_CONDITIONAL([GEONAMES_SUPPORT], [test x"$enable_geonames" = x"yes"])
if test x"$enable_geonames" = x"yes"; then
AC_DEFINE([GEONAMES_SUPPORT], [], [Geonames geocoding])
PKG_CHECK_MODULES([DEPS_GEONAMES], [libcurl >= 7.21, json >= 0.9])
PKG_CHECK_MODULES([DEPS_GEONAMES], [libcurl >= 7.21, json-c >= 0.12])
fi

View file

@ -28,7 +28,7 @@
#include <string.h>
#include <curl/curl.h>
#include <json/json.h>
#include <json-c/json.h>
#include "../config.h"
#include "geonames.h"
@ -59,7 +59,7 @@ static size_t json_parse_callback(void *contents, size_t size, size_t nmemb, voi
json_tokener_free(jtok);
}
else if (jtok->err != json_tokener_continue) {
fprintf(stderr, "parse error: %s\r\n", json_tokener_errors[jtok->err]);
fprintf(stderr, "parse error: %s\r\n", json_tokener_get_error(jtok));
*(void **) userp = NULL;
json_tokener_free(jtok);
}

View file

@ -26,7 +26,7 @@
#ifndef _GEONAMES_H_
#define _GEONAMES_H_
#include <json/json.h>
#include <json-c/json.h>
#define GEONAMES_CACHE_SUPPORT 1
#define GEONAMES_CACHE_FILE ".geonames.cache" /* in users home dir */