From 473c5484d87c5e73722e4f3b5deafb941ca45083 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Wed, 25 Jun 2014 07:25:23 +0000 Subject: [PATCH] Report libjson version from postgis_full_version(), closing #2159 git-svn-id: http://svn.osgeo.org/postgis/trunk@12652 b70326c6-7e19-0410-871a-916f4a2858ee --- NEWS | 1 + postgis/lwgeom_in_geojson.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/NEWS b/NEWS index b0c62dd5a..72b7024ae 100644 --- a/NEWS +++ b/NEWS @@ -17,6 +17,7 @@ PostGIS 2.2.0 * New Features * + - #2159, report libjson version from postgis_full_version() - #2770, ST_MemSize(raster) - Add postgis_noop(raster) - Added missing variants of ST_TPI(), ST_TRI() and ST_Roughness() diff --git a/postgis/lwgeom_in_geojson.c b/postgis/lwgeom_in_geojson.c index 8a0ddfc94..e69d99b03 100644 --- a/postgis/lwgeom_in_geojson.c +++ b/postgis/lwgeom_in_geojson.c @@ -17,6 +17,14 @@ #include "liblwgeom.h" #include "lwgeom_export.h" +#ifdef HAVE_LIBJSON +# ifdef HAVE_LIBJSON_C +# include +# else +# include +# endif +#endif + Datum geom_from_geojson(PG_FUNCTION_ARGS); Datum postgis_libjson_version(PG_FUNCTION_ARGS); @@ -26,7 +34,11 @@ Datum postgis_libjson_version(PG_FUNCTION_ARGS) #ifndef HAVE_LIBJSON PG_RETURN_NULL(); #else /* HAVE_LIBJSON */ +# ifdef JSON_C_VERSION + const char *ver = json_c_version(); +# else const char *ver = "UNKNOWN"; +# endif text *result = cstring2text(ver); PG_RETURN_POINTER(result); #endif -- 2.50.0