[geos-devel] patch to make geos compile with gcc 2.95
strk at refractions.net
strk at refractions.net
Mon Mar 14 15:10:01 EST 2005
Thanks Bernhard, the code is already present in current CVS, but
commented out..
// This seems to be needed by GCC 2.95.4
//friend class Polygonizer::LineStringAdder;
I wasn't sure about adding it, if noone sees any problem I'll uncomment.
--strk;
On Mon, Mar 14, 2005 at 08:17:09PM +0100, Bernhard Herzog wrote:
>
>
> I've briefly tested geos a bit with postgis. I needed to make two
> changes to geos-2.1.1.tar.bz2 to get it to compile on my system which
> uses gcc 2.95.4. One was the stdio include for sprintf which has
> already been reported.
>
> The other is that at least one of LineStringAdder's methods tries to
> access a private member of Polygonizer. LineStringAdder is a nested
> class inside of Polygonizer but that doesn't automatically give it
> access to Polygonizer's private members. The patch below makes
> LineStringAdder a friend of Polygonizer to fix this. Newer versions of
> gcc apparently allow this kind of access, but gcc 2.95 is correct in
> rejecting it, AFAIK. Stroustrup 3rd ed. says:
>
> C.11.3 Access to Member Class
>
> The members of a member class have no special access to members of an
> enclosing class.
>
>
>
> *** source/headers/geos/opPolygonize.h.~1~ Tue Dec 14 11:35:44 2004
> --- source/headers/geos/opPolygonize.h Fri Mar 11 14:56:41 2005
> ***************
> *** 397,402 ****
> --- 397,407 ----
> void filter_ro(const Geometry *g){};
> };
>
> + // Make LineStringAdder a fried of Polygonizer so that
> + // LineStringAdder's methods can access Polygonizer's private
> + // parts.
> + friend LineStringAdder;
> +
> // default factory
> LineStringAdder *lineStringAdder;
>
>
>
>
> Bernhard
>
> --
> Intevation GmbH http://intevation.de/
> Skencil http://skencil.org/
> Thuban http://thuban.intevation.org/
> _______________________________________________
> geos-devel mailing list
> geos-devel at geos.refractions.net
> http://geos.refractions.net/mailman/listinfo/geos-devel
More information about the geos-devel
mailing list