[postgis-tickets] r16173 - Fix warning when building against GEOS < 3.5

Sandro Santilli strk at kbt.io
Wed Dec 20 11:34:43 PST 2017


Author: strk
Date: 2017-12-20 11:34:43 -0800 (Wed, 20 Dec 2017)
New Revision: 16173

Modified:
   trunk/liblwgeom/lwgeom_geos.c
Log:
Fix warning when building against GEOS < 3.5

See https://gitlab.com/postgis/postgis/-/jobs/45372613

Modified: trunk/liblwgeom/lwgeom_geos.c
===================================================================
--- trunk/liblwgeom/lwgeom_geos.c	2017-12-20 19:28:16 UTC (rev 16172)
+++ trunk/liblwgeom/lwgeom_geos.c	2017-12-20 19:34:43 UTC (rev 16173)
@@ -2059,6 +2059,15 @@
 #endif /* POSTGIS_GEOS_VERSION < 34 */
 }
 
+#if POSTGIS_GEOS_VERSION < 35
+LWGEOM* lwgeom_voronoi_diagram(const LWGEOM* g, const GBOX* env, double tolerance, int output_edges)
+{
+	lwerror("lwgeom_voronoi_diagram: GEOS 3.5 or higher required");
+	return NULL;
+}
+
+#else /* POSTGIS_GEOS_VERSION >= 35 */
+
 static
 GEOSCoordSequence* lwgeom_get_geos_coordseq_2d(const LWGEOM* g, uint32_t num_points)
 {
@@ -2096,11 +2105,8 @@
 	return coords;
 }
 
-LWGEOM* lwgeom_voronoi_diagram(const LWGEOM* g, const GBOX* env, double tolerance, int output_edges) {
-#if POSTGIS_GEOS_VERSION < 35
-	lwerror("lwgeom_voronoi_diagram: GEOS 3.5 or higher required");
-	return NULL;
-#else
+LWGEOM* lwgeom_voronoi_diagram(const LWGEOM* g, const GBOX* env, double tolerance, int output_edges)
+{
 	uint32_t num_points = lwgeom_count_vertices(g);
 	LWGEOM *lwgeom_result;
 	char is_3d = LW_FALSE;
@@ -2156,5 +2162,6 @@
 	lwgeom_set_srid(lwgeom_result, srid);
 
 	return lwgeom_result;
-#endif /* POSTGIS_GEOS_VERSION < 35 */
 }
+
+#endif /* POSTGIS_GEOS_VERSION >= 35 */



More information about the postgis-tickets mailing list