Unbreak after json-c update.

This commit is contained in:
landry 2014-04-24 16:21:27 +00:00
parent e50cb8e196
commit 6ca04f3efe
2 changed files with 51 additions and 0 deletions

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-configure,v 1.1 2014/04/24 16:21:27 landry Exp $
--- configure.orig Thu Apr 24 18:03:19 2014
+++ configure Thu Apr 24 18:04:04 2014
@@ -18376,7 +18376,7 @@ fi
CPPFLAGS_SAVE="$CPPFLAGS"
CPPFLAGS="$JSON_CPPFLAGS"
-ac_fn_c_check_header_mongrel "$LINENO" "json/json.h" "ac_cv_header_json_json_h" "$ac_includes_default"
+ac_fn_c_check_header_mongrel "$LINENO" "json-c/json.h" "ac_cv_header_json_json_h" "$ac_includes_default"
if test "x$ac_cv_header_json_json_h" = x""yes; then :
HAVE_JSON=yes
fi

View File

@ -0,0 +1,39 @@
$OpenBSD: patch-liblwgeom_lwin_geojson_c,v 1.1 2014/04/24 16:21:27 landry Exp $
json_tokener.h had this at some point, then it got completely removed..
/**
* @b XXX do not use json_tokener_errors directly.
* After v0.10 this will be removed.
*
* See json_tokener_error_desc() instead.
*/
extern const char* json_tokener_errors[];
commit f9136f68520db4761f05810f97922900ba459f46
Author: Eric Haszlakiewicz <erh+git@nimenees.com>
Date: Sat Mar 22 21:41:24 2014 -0400
Make the json_tokener_errors array local. It has been deprecated for a while, and json_tokener_error_desc() should be used instead.
--- liblwgeom/lwin_geojson.c.orig Thu Feb 28 18:42:49 2013
+++ liblwgeom/lwin_geojson.c Thu Apr 24 18:10:55 2014
@@ -17,8 +17,8 @@
#ifdef HAVE_LIBJSON
-#include <json/json.h>
-#include <json/json_object_private.h>
+#include <json-c/json.h>
+#include <json-c/json_object_private.h>
#include <string.h>
static void geojson_lwerror(char *msg, int error_code)
@@ -512,7 +512,7 @@ lwgeom_from_geojson(const char *geojson, char **srs)
if( jstok->err != json_tokener_success)
{
char err[256];
- snprintf(err, 256, "%s (at offset %d)", json_tokener_errors[jstok->err], jstok->char_offset);
+ snprintf(err, 256, "%s (at offset %d)", json_tokener_error_desc(jstok->err), jstok->char_offset);
json_tokener_free(jstok);
json_object_put(poObj);
geojson_lwerror(err, 1);