[postgis-tickets] r16155 - Do not include private header for json-c >= 0.13

Darafei komzpa at gmail.com
Sat Dec 16 02:40:06 PST 2017


Author: komzpa
Date: 2017-12-16 02:40:06 -0800 (Sat, 16 Dec 2017)
New Revision: 16155

Modified:
   trunk/NEWS
   trunk/liblwgeom/lwin_geojson.c
Log:
Do not include private header for json-c >= 0.13

Patch by Bj?\195?\182rn Esser

Closes #3942
Closes https://github.com/postgis/postgis/pull/173



Modified: trunk/NEWS
===================================================================
--- trunk/NEWS	2017-12-15 17:44:37 UTC (rev 16154)
+++ trunk/NEWS	2017-12-16 10:40:06 UTC (rev 16155)
@@ -26,6 +26,7 @@
   - #3234, Do not accept EMPTY points as topology nodes (Sandro Santilli)
   - #1014, Hashable geometry, allowing direct use in CTE signatures (Paul Ramsey)
   - #3097, Really allow MULTILINESTRING blades in ST_Split() (Paul Ramsey)
+  - #3942, geojson: Do not include private header for json-c >= 0.13 (Björn Esser)
 
 
 PostGIS 2.4.0

Modified: trunk/liblwgeom/lwin_geojson.c
===================================================================
--- trunk/liblwgeom/lwin_geojson.c	2017-12-15 17:44:37 UTC (rev 16154)
+++ trunk/liblwgeom/lwin_geojson.c	2017-12-16 10:40:06 UTC (rev 16155)
@@ -31,13 +31,19 @@
 
 #if defined(HAVE_LIBJSON) || defined(HAVE_LIBJSON_C) /* --{ */
 
+#define JSON_C_VERSION_013 (13 << 8)
+
 #ifdef HAVE_LIBJSON_C
 #include <json-c/json.h>
+#if !defined(JSON_C_VERSION_NUM) || JSON_C_VERSION_NUM < JSON_C_VERSION_013
 #include <json-c/json_object_private.h>
+#endif
 #else
 #include <json/json.h>
+#if !defined(JSON_C_VERSION_NUM) || JSON_C_VERSION_NUM < JSON_C_VERSION_013
 #include <json/json_object_private.h>
 #endif
+#endif
 
 #ifndef JSON_C_VERSION
 /* Adds support for libjson < 0.10 */



More information about the postgis-tickets mailing list