]> granicus.if.org Git - postgis/commitdiff
Report libjson version from postgis_full_version(), closing #2159
authorSandro Santilli <strk@keybit.net>
Wed, 25 Jun 2014 07:25:23 +0000 (07:25 +0000)
committerSandro Santilli <strk@keybit.net>
Wed, 25 Jun 2014 07:25:23 +0000 (07:25 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@12652 b70326c6-7e19-0410-871a-916f4a2858ee

NEWS
postgis/lwgeom_in_geojson.c

diff --git a/NEWS b/NEWS
index b0c62dd5ad372c98ab75afe235ee9dff98bb8a3f..72b7024ae9a2dd2129323acff8f5934dc4c1ec9b 100644 (file)
--- 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()
index 8a0ddfc94f767a60d92c613788a3b39424c34750..e69d99b038e0ffbae85b0981a9f99c873b6ee166 100644 (file)
 #include "liblwgeom.h"
 #include "lwgeom_export.h"
 
+#ifdef HAVE_LIBJSON
+# ifdef HAVE_LIBJSON_C
+#  include <json-c/json.h>
+# else
+#  include <json/json.h>
+# 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