From fa762ce9712add6178becb2d9802fc51f9b8e224 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Fri, 7 Feb 2014 22:36:33 -0800 Subject: [PATCH] now that we only support boost >= 1.47 we can remove older phoenix support --- include/mapnik/css_color_grammar.hpp | 4 - include/mapnik/expression_grammar.hpp | 8 -- .../mapnik/json/feature_collection_parser.hpp | 3 - include/mapnik/json/feature_grammar.hpp | 37 --------- .../json/geometry_generator_grammar.hpp | 76 ------------------- include/mapnik/json/geometry_grammar.hpp | 71 ----------------- include/mapnik/json/symbolizer_grammar.hpp | 1 - include/mapnik/json/topojson_grammar.hpp | 12 +-- include/mapnik/svg/svg_path_commands.hpp | 36 --------- include/mapnik/svg/svg_transform_grammar.hpp | 20 ----- .../mapnik/util/geometry_svg_generator.hpp | 31 -------- include/mapnik/wkt/wkt_grammar.hpp | 5 -- tests/cpp_tests/line_offset_test.cpp | 2 - tests/cpp_tests/symbolizer_test.cpp | 2 - 14 files changed, 7 insertions(+), 301 deletions(-) diff --git a/include/mapnik/css_color_grammar.hpp b/include/mapnik/css_color_grammar.hpp index 2aa30d253..94f97f257 100644 --- a/include/mapnik/css_color_grammar.hpp +++ b/include/mapnik/css_color_grammar.hpp @@ -104,11 +104,7 @@ struct alpha_conv_impl struct hsl_conv_impl { -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 template -#else - template -#endif struct result { typedef void type; diff --git a/include/mapnik/expression_grammar.hpp b/include/mapnik/expression_grammar.hpp index bf782583b..6674f2129 100644 --- a/include/mapnik/expression_grammar.hpp +++ b/include/mapnik/expression_grammar.hpp @@ -65,11 +65,7 @@ struct unicode_impl struct regex_match_impl { -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 template -#else - template -#endif struct result { typedef expr_node type; @@ -87,11 +83,7 @@ struct regex_match_impl struct regex_replace_impl { -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 template -#else - template -#endif struct result { typedef expr_node type; diff --git a/include/mapnik/json/feature_collection_parser.hpp b/include/mapnik/json/feature_collection_parser.hpp index 39e0e81e9..27f803fb2 100644 --- a/include/mapnik/json/feature_collection_parser.hpp +++ b/include/mapnik/json/feature_collection_parser.hpp @@ -29,9 +29,6 @@ #include #include -// boost - - // stl #include diff --git a/include/mapnik/json/feature_grammar.hpp b/include/mapnik/json/feature_grammar.hpp index 5252af283..7064cdec4 100644 --- a/include/mapnik/json/feature_grammar.hpp +++ b/include/mapnik/json/feature_grammar.hpp @@ -67,7 +67,6 @@ public: mapnik::transcoder const& tr_; }; -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 struct put_property { typedef void result_type; @@ -90,42 +89,6 @@ struct extract_geometry return feature.paths(); } }; -#else -struct put_property -{ - template - struct result - { - typedef void type; - }; - explicit put_property(mapnik::transcoder const& tr) - : tr_(tr) {} - - template - void operator() (T0 & feature, T1 const& key, T2 const& val) const - { - mapnik::value v = boost::apply_visitor(attribute_value_visitor(tr_),val); // TODO: optimize - feature.put_new(key, v); - } - - mapnik::transcoder const& tr_; -}; - -struct extract_geometry -{ - template - struct result - { - typedef boost::ptr_vector& type; - }; - - template - boost::ptr_vector& operator() (T & feature) const - { - return feature.paths(); - } -}; -#endif template struct feature_grammar : diff --git a/include/mapnik/json/geometry_generator_grammar.hpp b/include/mapnik/json/geometry_generator_grammar.hpp index 8652a8db3..37a01e896 100644 --- a/include/mapnik/json/geometry_generator_grammar.hpp +++ b/include/mapnik/json/geometry_generator_grammar.hpp @@ -58,7 +58,6 @@ namespace phoenix = boost::phoenix; namespace { -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 struct get_type { typedef int result_type; @@ -117,81 +116,6 @@ struct not_empty } }; -#else -struct get_type -{ - template - struct result { typedef int type; }; - - int operator() (geometry_type const& geom) const - { - return static_cast(geom.type()); - } -}; - -struct get_first -{ - template - struct result { typedef geometry_type::value_type const type; }; - - geometry_type::value_type const operator() (geometry_type const& geom) const - { - geometry_type::value_type coord; - std::get<0>(coord) = geom.vertex(0,&std::get<1>(coord),&std::get<2>(coord)); - return coord; - } -}; - -struct multi_geometry_type -{ - template - struct result { typedef std::tuple type; }; - - std::tuple operator() (geometry_container const& geom) const - { - unsigned type = 0u; - bool collection = false; - - geometry_container::const_iterator itr = geom.begin(); - geometry_container::const_iterator end = geom.end(); - - for ( ; itr != end; ++itr) - { - if (type != 0u && static_cast(itr->type()) != type) - { - collection = true; - break; - } - type = itr->type(); - } - if (geom.size() > 1) type +=3; - return std::tuple(type, collection); - } -}; - - -struct not_empty -{ - template - struct result { typedef bool type; }; - - bool operator() (geometry_container const& cont) const - { - geometry_container::const_iterator itr = cont.begin(); - geometry_container::const_iterator end = cont.end(); - - for (; itr!=end; ++itr) - { - if (itr->size() > 0) return true; - } - return false; - } -}; - - -#endif - - template struct json_coordinate_policy : karma::real_policies { diff --git a/include/mapnik/json/geometry_grammar.hpp b/include/mapnik/json/geometry_grammar.hpp index 157d0e6b1..45aaa3ed0 100644 --- a/include/mapnik/json/geometry_grammar.hpp +++ b/include/mapnik/json/geometry_grammar.hpp @@ -37,7 +37,6 @@ namespace qi = boost::spirit::qi; namespace standard_wide = boost::spirit::standard_wide; using standard_wide::space_type; -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 struct push_vertex { typedef void result_type; @@ -88,76 +87,6 @@ struct where_message return str; } }; -#else -struct push_vertex -{ - template - struct result - { - typedef void type; - }; - - template - void operator() (T0 c, T1 path, T2 x, T3 y) const - { - BOOST_ASSERT( path!=0 ); - path->push_vertex(x,y,c); - } -}; - -struct close_path -{ - template - struct result - { - typedef void type; - }; - - template - void operator() (T path) const - { - BOOST_ASSERT( path!=0 ); - if (path->size() > 2u) // to form a polygon ring we need at least 3 vertices - { - path->close_path(); - } - } -}; - -struct cleanup -{ - template - struct result - { - typedef void type; - }; - - template - void operator() (T0 & path) const - { - if (path) delete path, path=0; - } -}; - -struct where_message -{ - template - struct result - { - typedef std::string type; - }; - - template - std::string operator() (Iterator first, Iterator last, std::size_t size) const - { - std::string str(first, last); - if (str.length() > size) - return str.substr(0, size) + "..." ; - return str; - } -}; -#endif - template struct geometry_grammar : diff --git a/include/mapnik/json/symbolizer_grammar.hpp b/include/mapnik/json/symbolizer_grammar.hpp index 89a0cf25f..ce239e8a2 100644 --- a/include/mapnik/json/symbolizer_grammar.hpp +++ b/include/mapnik/json/symbolizer_grammar.hpp @@ -24,7 +24,6 @@ #define MAPNIK_SYMBOLIZER_GRAMMAR_HPP // boost -#define BOOST_SPIRIT_USE_PHOENIX_V3 1 #include #include diff --git a/include/mapnik/json/topojson_grammar.hpp b/include/mapnik/json/topojson_grammar.hpp index cf14c55e6..1d78c03b4 100644 --- a/include/mapnik/json/topojson_grammar.hpp +++ b/include/mapnik/json/topojson_grammar.hpp @@ -23,13 +23,15 @@ #ifndef MAPNIK_TOPOJSON_GRAMMAR_HPP #define MAPNIK_TOPOJSON_GRAMMAR_HPP -#define BOOST_SPIRIT_USE_PHOENIX_V3 1 -#include -#include -// +// mapnik #include #include -// + +// boost +#include +#include + +// stl #include namespace mapnik { namespace topojson { diff --git a/include/mapnik/svg/svg_path_commands.hpp b/include/mapnik/svg/svg_path_commands.hpp index ba631ed76..651a8edb9 100644 --- a/include/mapnik/svg/svg_path_commands.hpp +++ b/include/mapnik/svg/svg_path_commands.hpp @@ -46,11 +46,7 @@ template struct move_to { -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 template -#else - template -#endif struct result { typedef void type; @@ -71,11 +67,7 @@ struct move_to template struct hline_to { -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 template -#else - template -#endif struct result { typedef void type; @@ -97,11 +89,7 @@ struct hline_to template struct vline_to { -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 template -#else - template -#endif struct result { typedef void type; @@ -122,11 +110,7 @@ struct vline_to template struct line_to { -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 template -#else - template -#endif struct result { typedef void type; @@ -148,11 +132,7 @@ struct line_to template struct curve4 { -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 template -#else - template -#endif struct result { typedef void type; @@ -177,11 +157,7 @@ struct curve4 template struct curve4_smooth { -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 template -#else - template -#endif struct result { typedef void type; @@ -203,11 +179,7 @@ struct curve4_smooth template struct curve3 { -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 template -#else - template -#endif struct result { typedef void type; @@ -230,11 +202,7 @@ struct curve3 template struct curve3_smooth { -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 template -#else - template -#endif struct result { typedef void type; @@ -256,11 +224,7 @@ struct curve3_smooth template struct arc_to { -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 template -#else - template -#endif struct result { typedef void type; diff --git a/include/mapnik/svg/svg_transform_grammar.hpp b/include/mapnik/svg/svg_transform_grammar.hpp index bbc43e661..864578764 100644 --- a/include/mapnik/svg/svg_transform_grammar.hpp +++ b/include/mapnik/svg/svg_transform_grammar.hpp @@ -50,11 +50,7 @@ namespace mapnik { namespace svg { template struct process_matrix { -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 template -#else - template -#endif struct result { typedef void type; @@ -74,11 +70,7 @@ namespace mapnik { namespace svg { template struct process_rotate { -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 template -#else - template -#endif struct result { typedef void type; @@ -109,11 +101,7 @@ namespace mapnik { namespace svg { template struct process_translate { -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 template -#else - template -#endif struct result { typedef void type; @@ -135,11 +123,7 @@ namespace mapnik { namespace svg { template struct process_scale { -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 template -#else - template -#endif struct result { typedef void type; @@ -162,11 +146,7 @@ namespace mapnik { namespace svg { template struct process_skew { -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 template -#else - template -#endif struct result { typedef void type; diff --git a/include/mapnik/util/geometry_svg_generator.hpp b/include/mapnik/util/geometry_svg_generator.hpp index 659427312..567cd5560 100644 --- a/include/mapnik/util/geometry_svg_generator.hpp +++ b/include/mapnik/util/geometry_svg_generator.hpp @@ -91,7 +91,6 @@ namespace mapnik { namespace util { namespace svg_detail { -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 template struct get_type { @@ -115,37 +114,7 @@ namespace mapnik { namespace util { return coord; } }; -#else - template - struct get_type - { - template - struct result { typedef int type; }; - int operator() (Geometry const& geom) const - { - return static_cast(geom.type()); - } - }; - - template - struct get_first - { - typedef T geometry_type; - - template - struct result { typedef typename geometry_type::value_type const type; }; - - typename geometry_type::value_type operator() (geometry_type const& geom) const - { - typename geometry_type::value_type coord; - geom.rewind(0); - std::get<0>(coord) = geom.vertex(&std::get<1>(coord),&std::get<2>(coord)); - return coord; - } - }; - -#endif template struct coordinate_policy : karma::real_policies { diff --git a/include/mapnik/wkt/wkt_grammar.hpp b/include/mapnik/wkt/wkt_grammar.hpp index 0e20138b5..b7e3ff379 100644 --- a/include/mapnik/wkt/wkt_grammar.hpp +++ b/include/mapnik/wkt/wkt_grammar.hpp @@ -44,11 +44,7 @@ namespace mapnik { namespace wkt { struct push_vertex { -#ifdef BOOST_SPIRIT_USE_PHOENIX_V3 template -#else - template -#endif struct result { typedef void type; @@ -233,7 +229,6 @@ struct wkt_collection_grammar : qi::grammar> (lit("(") >> wkt % lit(",") >> lit(")")); } diff --git a/tests/cpp_tests/line_offset_test.cpp b/tests/cpp_tests/line_offset_test.cpp index 8f311e17e..43a70ea41 100644 --- a/tests/cpp_tests/line_offset_test.cpp +++ b/tests/cpp_tests/line_offset_test.cpp @@ -227,9 +227,7 @@ int main(int argc, char** argv) { if (quiet) std::clog << "\x1b[1;32m.\x1b[0m"; else std::clog << "C++ line offset: \x1b[1;32m✓ \x1b[0m\n"; -#if BOOST_VERSION >= 104600 ::boost::detail::report_errors_remind().called_report_errors_function = true; -#endif } else { diff --git a/tests/cpp_tests/symbolizer_test.cpp b/tests/cpp_tests/symbolizer_test.cpp index 0fb103be3..78bd55b22 100644 --- a/tests/cpp_tests/symbolizer_test.cpp +++ b/tests/cpp_tests/symbolizer_test.cpp @@ -33,9 +33,7 @@ int main(int argc, char** argv) if (!::boost::detail::test_errors()) { if (quiet) std::clog << "\x1b[1;32m.\x1b[0m"; else std::clog << "C++ exceptions: \x1b[1;32m✓ \x1b[0m\n"; -#if BOOST_VERSION >= 104600 ::boost::detail::report_errors_remind().called_report_errors_function = true; -#endif } else { return ::boost::report_errors(); }