From bbfd11190069444e609378342cdeed679b01a157 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Sun, 28 Jul 2013 12:54:31 -0400 Subject: [PATCH] fix PHOENIX_V3 compile of svg generator --- .../mapnik/util/geometry_svg_generator.hpp | 30 +++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/include/mapnik/util/geometry_svg_generator.hpp b/include/mapnik/util/geometry_svg_generator.hpp index 4c6b5845e..acb4ca8e5 100644 --- a/include/mapnik/util/geometry_svg_generator.hpp +++ b/include/mapnik/util/geometry_svg_generator.hpp @@ -91,6 +91,31 @@ namespace mapnik { namespace util { namespace svg_detail { +#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 + template + struct get_type + { + typedef int result_type; + result_type operator() (Geometry const& geom) const + { + return static_cast(geom.type()); + } + }; + + template + struct get_first + { + typedef T geometry_type; + typedef typename geometry_type::value_type const result_type; + result_type operator() (geometry_type const& geom) const + { + typename geometry_type::value_type coord; + geom.rewind(0); + boost::get<0>(coord) = geom.vertex(&boost::get<1>(coord),&boost::get<2>(coord)); + return coord; + } + }; +#else template struct get_type { @@ -111,7 +136,7 @@ namespace mapnik { namespace util { template struct result { typedef typename geometry_type::value_type const type; }; - typename geometry_type::value_type const operator() (geometry_type const& geom) const + typename geometry_type::value_type operator() (geometry_type const& geom) const { typename geometry_type::value_type coord; geom.rewind(0); @@ -120,6 +145,7 @@ namespace mapnik { namespace util { } }; +#endif template struct coordinate_policy : karma::real_policies { @@ -168,7 +194,7 @@ namespace mapnik { namespace util { ; svg_path %= ((&uint_(mapnik::SEG_MOVETO) << lit('M') - | &uint_(mapnik::SEG_LINETO) [_a +=1] << karma::string [if_(_a == 1) [_1 = "L" ] ]) + | &uint_(mapnik::SEG_LINETO) [_a +=1] << karma::string [if_(_a == 1) [_1 = "L" ].else_[_1 =""]]) << lit(' ') << coordinate << lit(' ') << coordinate) % lit(' ') ;