Merge pull request #1 from therealshredder/master

Fix build errors and add a few missing includes to silence build warnings
This commit is contained in:
Steffen Vogel 2015-07-09 12:09:12 +02:00
commit 4e4f01ccbd
5 changed files with 6 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

@ -46,6 +46,7 @@
#include "objects.h"
#include "helpers.h"
#include "formatter.h"
#include "geonames.h"
enum moment {
MOMENT_NOW,

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 */

View file

@ -27,6 +27,7 @@
#include <stdio.h>
#include <string.h>
#include <time.h>
#include <math.h>
#include <libnova/libnova.h>