[postgis-commits] svn - r2734 - trunk/lwgeom

postgis-commits at postgis.refractions.net postgis-commits at postgis.refractions.net
Tue Jan 22 11:44:25 PST 2008


Author: benjubb
Date: 2008-01-22 11:44:25 -0800 (Tue, 22 Jan 2008)
New Revision: 2734

Modified:
   trunk/lwgeom/lwgeom_geos_c.c
Log:
Ammended to include prepared geometry cache code in scope of PREPARED_GEOM symbol.




Modified: trunk/lwgeom/lwgeom_geos_c.c
===================================================================
--- trunk/lwgeom/lwgeom_geos_c.c	2008-01-22 00:24:42 UTC (rev 2733)
+++ trunk/lwgeom/lwgeom_geos_c.c	2008-01-22 19:44:25 UTC (rev 2734)
@@ -3587,15 +3587,22 @@
 }
 
 
-#if ( GEOS_VERSION_MAJOR > 3 || (GEOS_VERSION_MAJOR == 3 && GEOS_VERSION_MINOR >= 1) ) && ( GEOS_CAPI_VERSION_MAJOR > 1 || (GEOS_CAPI_VERSION_MAJOR == 1 && GEOS_CAPI_VERSION_MINOR >= 5) )
-#define PREPARED_GEOM 1
-#endif
-
 Datum containsPrepared(PG_FUNCTION_ARGS);
 Datum containsProperlyPrepared(PG_FUNCTION_ARGS);
 Datum coversPrepared(PG_FUNCTION_ARGS);
 Datum intersectsPrepared(PG_FUNCTION_ARGS);
 
+/*
+ * GEOS prepared geometry is only available from GEOS 3.1 onwards
+ */
+#if ( GEOS_VERSION_MAJOR > 3 || (GEOS_VERSION_MAJOR == 3 && GEOS_VERSION_MINOR >= 1) ) 
+/* #if ( GEOS_CAPI_VERSION_MAJOR > 1 || (GEOS_CAPI_VERSION_MAJOR == 1 && GEOS_CAPI_VERSION_MINOR >= 5) ) */
+#define PREPARED_GEOM 1
+#endif
+
+
+#ifdef PREPARED_GEOM
+
 typedef struct
 {
 	Size 					serialized_geom_length;
@@ -3682,9 +3689,9 @@
 	return cache;
 }
 
+#endif
 
 
-
 PG_FUNCTION_INFO_V1(containsPrepared);
 Datum containsPrepared(PG_FUNCTION_ARGS)
 {



More information about the postgis-commits mailing list