From 0905bf8ba5f33b86d84348a3a9f615d2ee3605df Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Wed, 21 Sep 2011 09:50:15 +0000 Subject: [PATCH] Add header guards to geos headers, move GEOS_PREPARED define to the implementation file, add missing copyright header. git-svn-id: http://svn.osgeo.org/postgis/trunk@7879 b70326c6-7e19-0410-871a-916f4a2858ee --- postgis/lwgeom_geos.c | 10 +++++++++- postgis/lwgeom_geos.h | 11 ++++------- postgis/lwgeom_geos_prepared.h | 20 ++++---------------- postgis/profile.h | 12 ++++++++++++ 4 files changed, 29 insertions(+), 24 deletions(-) diff --git a/postgis/lwgeom_geos.c b/postgis/lwgeom_geos.c index 9a896f95e..8ce24ef65 100644 --- a/postgis/lwgeom_geos.c +++ b/postgis/lwgeom_geos.c @@ -15,10 +15,18 @@ #include "lwgeom_geos.h" #include "liblwgeom_internal.h" #include "lwgeom_rtree.h" -#include "lwgeom_geos_prepared.h" /* for PREPARED_GEOM define */ #include "lwgeom_functions_analytic.h" /* for point_in_polygon */ #include "funcapi.h" +/* +** GEOS prepared geometry is only available from GEOS 3.1 onwards +*/ +#define PREPARED_GEOM + +#ifdef PREPARED_GEOM +#include "lwgeom_geos_prepared.h" +#endif + #include #include diff --git a/postgis/lwgeom_geos.h b/postgis/lwgeom_geos.h index 604197fb9..dcc4f00e1 100644 --- a/postgis/lwgeom_geos.h +++ b/postgis/lwgeom_geos.h @@ -10,6 +10,9 @@ * **********************************************************************/ +#ifndef LWGEOM_GEOS_H_ +#define LWGEOM_GEOS_H_ 1 + #include "postgres.h" #include "fmgr.h" #include "miscadmin.h" @@ -21,13 +24,6 @@ #include "../postgis_config.h" -/* Workaround for GEOS 2.2 compatibility: old geos_c.h does not contain - header guards to protect from multiple inclusion */ -#ifndef GEOS_C_INCLUDED -#define GEOS_C_INCLUDED -#include "geos_c.h" -#endif - #include "lwgeom_pg.h" #include "liblwgeom.h" #include "profile.h" @@ -50,3 +46,4 @@ GEOSGeometry * POSTGIS2GEOS(PG_LWGEOM *g); void errorIfGeometryCollection(PG_LWGEOM *g1, PG_LWGEOM *g2); +#endif /* LWGEOM_GEOS_H_ 1 */ diff --git a/postgis/lwgeom_geos_prepared.h b/postgis/lwgeom_geos_prepared.h index 7107ce9e3..81eeadc61 100644 --- a/postgis/lwgeom_geos_prepared.h +++ b/postgis/lwgeom_geos_prepared.h @@ -10,6 +10,9 @@ * **********************************************************************/ +#ifndef LWGEOM_GEOS_PREPARED_H_ +#define LWGEOM_GEOS_PREPARED_H_ 1 + #include "postgres.h" #include "fmgr.h" #include "miscadmin.h" @@ -19,22 +22,10 @@ #include "../postgis_config.h" -/* Workaround for GEOS 2.2 compatibility: old geos_c.h does not contain - header guards to protect from multiple inclusion */ -#ifndef GEOS_C_INCLUDED -#define GEOS_C_INCLUDED -#include "geos_c.h" -#endif - #include "lwgeom_pg.h" #include "liblwgeom.h" #include "lwgeom_geos.h" -/* -** GEOS prepared geometry is only available from GEOS 3.1 onwards -*/ -#define PREPARED_GEOM - /* ** Cache structure. We use PG_LWGEOM as keys so no transformations ** are needed before we memcmp them with other keys. We store the @@ -45,7 +36,6 @@ ** Both the Geometry and the PreparedGeometry have to be cached, ** because the PreparedGeometry contains a reference to the geometry. */ -#ifdef PREPARED_GEOM typedef struct { char type; @@ -70,6 +60,4 @@ PrepGeomCache; */ PrepGeomCache *GetPrepGeomCache(FunctionCallInfoData *fcinfo, PG_LWGEOM *pg_geom1, PG_LWGEOM *pg_geom2); - -#endif /* PREPARED_GEOM */ - +#endif /* LWGEOM_GEOS_PREPARED_H_ 1 */ diff --git a/postgis/profile.h b/postgis/profile.h index 8598f3639..239ca7097 100644 --- a/postgis/profile.h +++ b/postgis/profile.h @@ -1,3 +1,15 @@ +/********************************************************************** + * + * PostGIS - Spatial Types for PostgreSQL + * http://postgis.refractions.net + * + * Copyright (C) 2004 Sandro Santilli + * + * This is free software; you can redistribute and/or modify it under + * the terms of the GNU General Public Licence. See the COPYING file. + * + **********************************************************************/ + #ifndef _PROFILE_H #define _PROFILE_H 1 -- 2.50.0