From: Mark Cave-Ayland Date: Thu, 6 Nov 2008 16:12:11 +0000 (+0000) Subject: The GEOS 2.2 series "geos_c.h" is missing header guards, so including the header... X-Git-Tag: 1.4.0b1~522 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f4a689a3c79b6831f0b6daaad6cdad246b19a548;p=postgis The GEOS 2.2 series "geos_c.h" is missing header guards, so including the header multiple times as is done in lwgeom_geos.h and lwgeom_geos_prepared.h causes compilation to fail with multiple definition errors. This patch fixes this problem allowing GEOS 2.2 to work with PostGIS once again, although of course it can easily be removed when it is decided that GEOS 2.2 support is no longer required. git-svn-id: http://svn.osgeo.org/postgis/trunk@3262 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/lwgeom/lwgeom_geos.h b/lwgeom/lwgeom_geos.h index 1f4dc98f6..93b980d8c 100644 --- a/lwgeom/lwgeom_geos.h +++ b/lwgeom/lwgeom_geos.h @@ -23,7 +23,12 @@ #include "utils/memutils.h" #include "executor/spi.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" diff --git a/lwgeom/lwgeom_geos_prepared.h b/lwgeom/lwgeom_geos_prepared.h index 46701eae2..9651c7bbc 100644 --- a/lwgeom/lwgeom_geos_prepared.h +++ b/lwgeom/lwgeom_geos_prepared.h @@ -19,7 +19,12 @@ #include "utils/memutils.h" #include "access/hash.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"