From 0b4f3dc497a25f7874e0fb321cdf5d3e205dbe4a Mon Sep 17 00:00:00 2001 From: Artem Pavlenko Date: Mon, 21 Oct 2019 16:42:58 +0100 Subject: [PATCH 1/3] fix support for BOOST 1_71 --- include/mapnik/json/feature_generator_grammar.hpp | 11 +++++++++++ .../mapnik/json/properties_generator_grammar.hpp | 4 ++-- include/mapnik/svg/geometry_svg_generator.hpp | 14 +++++++------- src/css_color_grammar_x3.cpp | 2 ++ src/json/feature_grammar_x3.cpp | 5 +++++ src/json/generic_json_grammar_x3.cpp | 2 ++ src/json/geojson_grammar_x3.cpp | 8 ++++++-- src/json/positions_grammar_x3.cpp | 4 +++- src/json/unicode_string_grammar_x3.cpp | 2 ++ src/svg/svg_path_grammar_x3.cpp | 5 +++++ 10 files changed, 45 insertions(+), 12 deletions(-) diff --git a/include/mapnik/json/feature_generator_grammar.hpp b/include/mapnik/json/feature_generator_grammar.hpp index 9443968a3..6fb06cc9d 100644 --- a/include/mapnik/json/feature_generator_grammar.hpp +++ b/include/mapnik/json/feature_generator_grammar.hpp @@ -63,6 +63,17 @@ struct end_container } }; +template <> +struct transform_attribute + : detail::transform_attribute_base +{}; + +template <> +struct transform_attribute, const mapnik::feature_impl &, + boost::spirit::karma::domain, void> + : detail::transform_attribute_base, mapnik::feature_impl const&, boost::spirit::karma::domain> +{}; + }}} namespace mapnik { namespace json { diff --git a/include/mapnik/json/properties_generator_grammar.hpp b/include/mapnik/json/properties_generator_grammar.hpp index 950a2f0fb..93dfaef75 100644 --- a/include/mapnik/json/properties_generator_grammar.hpp +++ b/include/mapnik/json/properties_generator_grammar.hpp @@ -60,8 +60,8 @@ struct extract_string }; template -struct properties_generator_grammar : karma::grammar - +struct properties_generator_grammar + : karma::grammar { using pair_type = std::tuple; properties_generator_grammar(); diff --git a/include/mapnik/svg/geometry_svg_generator.hpp b/include/mapnik/svg/geometry_svg_generator.hpp index 92581f6ce..7ab983af4 100644 --- a/include/mapnik/svg/geometry_svg_generator.hpp +++ b/include/mapnik/svg/geometry_svg_generator.hpp @@ -141,7 +141,7 @@ struct coordinate_policy : karma::real_policies template struct svg_path_generator : - karma::grammar + karma::grammar { using path_type = Path; @@ -149,12 +149,12 @@ struct svg_path_generator : svg_path_generator(); // rules - karma::rule svg; - karma::rule point; - karma::rule linestring; - karma::rule polygon; - karma::rule svg_point; - karma::rule svg_path; + karma::rule svg; + karma::rule point; + karma::rule linestring; + karma::rule polygon; + karma::rule svg_point; + karma::rule svg_path; // phoenix functions phoenix::function > _type; diff --git a/src/css_color_grammar_x3.cpp b/src/css_color_grammar_x3.cpp index 5a7a6ed2c..5fc5a57e8 100644 --- a/src/css_color_grammar_x3.cpp +++ b/src/css_color_grammar_x3.cpp @@ -30,7 +30,9 @@ using context_type = x3::phrase_parse_context::type; BOOST_SPIRIT_INSTANTIATE(css_color_grammar_type, iterator_type, context_type); +#if BOOST_VERSION < 107000 template bool parse_rule (css_color_grammar_type, iterator_type&, iterator_type const&, context_type const&, mapnik::filter::color_to_alpha&); +#endif }} diff --git a/src/json/feature_grammar_x3.cpp b/src/json/feature_grammar_x3.cpp index 15ef359a8..2365b3050 100644 --- a/src/json/feature_grammar_x3.cpp +++ b/src/json/feature_grammar_x3.cpp @@ -27,6 +27,11 @@ namespace mapnik { namespace json { namespace grammar { BOOST_SPIRIT_INSTANTIATE(feature_grammar_type, iterator_type, feature_context_type); BOOST_SPIRIT_INSTANTIATE(geometry_grammar_type, iterator_type, phrase_parse_context_type); + +#if BOOST_VERSION >= 107000 +BOOST_SPIRIT_INSTANTIATE(feature_grammar_type, iterator_type, feature_context_const_type); +#else BOOST_SPIRIT_INSTANTIATE_UNUSED(feature_grammar_type, iterator_type, feature_context_const_type); +#endif }}} diff --git a/src/json/generic_json_grammar_x3.cpp b/src/json/generic_json_grammar_x3.cpp index 43997d71e..56b6b2237 100644 --- a/src/json/generic_json_grammar_x3.cpp +++ b/src/json/generic_json_grammar_x3.cpp @@ -30,8 +30,10 @@ BOOST_SPIRIT_INSTANTIATE(generic_json_grammar_type, iterator_type, context_type) BOOST_SPIRIT_INSTANTIATE(generic_json_grammar_type, iterator_type, feature_context_type); BOOST_SPIRIT_INSTANTIATE(generic_json_grammar_type, iterator_type, feature_context_const_type); +#if BOOST_VERSION < 107000 BOOST_SPIRIT_INSTANTIATE_UNUSED(generic_json_grammar_type, iterator_type, phrase_parse_context_type); BOOST_SPIRIT_INSTANTIATE_UNUSED(generic_json_grammar_type, iterator_type, feature_context_type); BOOST_SPIRIT_INSTANTIATE_UNUSED(generic_json_grammar_type, iterator_type, feature_context_const_type); +#endif }}} diff --git a/src/json/geojson_grammar_x3.cpp b/src/json/geojson_grammar_x3.cpp index 368f4e10e..de4f51e38 100644 --- a/src/json/geojson_grammar_x3.cpp +++ b/src/json/geojson_grammar_x3.cpp @@ -29,13 +29,17 @@ namespace mapnik { namespace json { namespace grammar { BOOST_SPIRIT_INSTANTIATE(geojson_grammar_type, iterator_type, context_type); BOOST_SPIRIT_INSTANTIATE(geojson_key_value_type, iterator_type, context_type); - BOOST_SPIRIT_INSTANTIATE(geojson_grammar_type, iterator_type, extract_bounding_boxes_context_type); +#if BOOST_VERSION >= 107000 +BOOST_SPIRIT_INSTANTIATE(geojson_grammar_type, iterator_type, extract_bounding_boxes_reverse_context_type); +BOOST_SPIRIT_INSTANTIATE(geojson_grammar_type, iterator_type, extract_bounding_boxes_context_type_f); +BOOST_SPIRIT_INSTANTIATE(geojson_grammar_type, iterator_type, extract_bounding_boxes_reverse_context_type_f); +#else BOOST_SPIRIT_INSTANTIATE_UNUSED(geojson_grammar_type, iterator_type, extract_bounding_boxes_context_type); BOOST_SPIRIT_INSTANTIATE_UNUSED(geojson_grammar_type, iterator_type, extract_bounding_boxes_reverse_context_type); - BOOST_SPIRIT_INSTANTIATE_UNUSED(geojson_grammar_type, iterator_type, extract_bounding_boxes_context_type_f); BOOST_SPIRIT_INSTANTIATE_UNUSED(geojson_grammar_type, iterator_type, extract_bounding_boxes_reverse_context_type_f); +#endif }}} diff --git a/src/json/positions_grammar_x3.cpp b/src/json/positions_grammar_x3.cpp index 101f1c725..fb9f96270 100644 --- a/src/json/positions_grammar_x3.cpp +++ b/src/json/positions_grammar_x3.cpp @@ -31,14 +31,16 @@ BOOST_SPIRIT_INSTANTIATE(positions_grammar_type, iterator_type, context_type); BOOST_SPIRIT_INSTANTIATE(positions_grammar_type, iterator_type, feature_context_type); BOOST_SPIRIT_INSTANTIATE(positions_grammar_type, iterator_type, feature_context_const_type); +#if BOOST_VERSION >=107000 BOOST_SPIRIT_INSTANTIATE(positions_grammar_type, iterator_type, extract_bounding_boxes_context_type); BOOST_SPIRIT_INSTANTIATE(positions_grammar_type, iterator_type, extract_bounding_boxes_reverse_context_type); BOOST_SPIRIT_INSTANTIATE(positions_grammar_type, iterator_type, extract_bounding_boxes_context_type_f); BOOST_SPIRIT_INSTANTIATE(positions_grammar_type, iterator_type, extract_bounding_boxes_reverse_context_type_f); - +#else BOOST_SPIRIT_INSTANTIATE_UNUSED(positions_grammar_type, iterator_type, extract_bounding_boxes_context_type); BOOST_SPIRIT_INSTANTIATE_UNUSED(positions_grammar_type, iterator_type, extract_bounding_boxes_reverse_context_type); BOOST_SPIRIT_INSTANTIATE_UNUSED(positions_grammar_type, iterator_type, extract_bounding_boxes_context_type_f); BOOST_SPIRIT_INSTANTIATE_UNUSED(positions_grammar_type, iterator_type, extract_bounding_boxes_reverse_context_type_f); +#endif }}} diff --git a/src/json/unicode_string_grammar_x3.cpp b/src/json/unicode_string_grammar_x3.cpp index 59838b7ab..cd870e9e9 100644 --- a/src/json/unicode_string_grammar_x3.cpp +++ b/src/json/unicode_string_grammar_x3.cpp @@ -35,6 +35,7 @@ BOOST_SPIRIT_INSTANTIATE(unicode_string_grammar_type, iterator_type, extract_bou BOOST_SPIRIT_INSTANTIATE(unicode_string_grammar_type, iterator_type, extract_bounding_boxes_context_type_f); BOOST_SPIRIT_INSTANTIATE(unicode_string_grammar_type, iterator_type, extract_bounding_boxes_reverse_context_type_f); +#if BOOST_VERSION < 107000 BOOST_SPIRIT_INSTANTIATE_UNUSED(unicode_string_grammar_type, iterator_type, phrase_parse_context_type); BOOST_SPIRIT_INSTANTIATE_UNUSED(unicode_string_grammar_type, iterator_type, feature_context_type); BOOST_SPIRIT_INSTANTIATE_UNUSED(unicode_string_grammar_type, iterator_type, feature_context_const_type); @@ -42,5 +43,6 @@ BOOST_SPIRIT_INSTANTIATE_UNUSED(unicode_string_grammar_type, iterator_type, extr BOOST_SPIRIT_INSTANTIATE_UNUSED(unicode_string_grammar_type, iterator_type, extract_bounding_boxes_reverse_context_type); BOOST_SPIRIT_INSTANTIATE_UNUSED(unicode_string_grammar_type, iterator_type, extract_bounding_boxes_context_type_f); BOOST_SPIRIT_INSTANTIATE_UNUSED(unicode_string_grammar_type, iterator_type, extract_bounding_boxes_reverse_context_type_f); +#endif }}} diff --git a/src/svg/svg_path_grammar_x3.cpp b/src/svg/svg_path_grammar_x3.cpp index 31a2622d0..654f65d00 100644 --- a/src/svg/svg_path_grammar_x3.cpp +++ b/src/svg/svg_path_grammar_x3.cpp @@ -25,7 +25,12 @@ namespace mapnik { namespace svg { namespace grammar { +#if BOOST_VERSION >= 107000 +BOOST_SPIRIT_INSTANTIATE(svg_path_grammar_type, iterator_type, svg_parse_context_type); +BOOST_SPIRIT_INSTANTIATE(svg_points_grammar_type, iterator_type, svg_parse_context_type); +#else BOOST_SPIRIT_INSTANTIATE_UNUSED(svg_path_grammar_type, iterator_type, svg_parse_context_type); BOOST_SPIRIT_INSTANTIATE_UNUSED(svg_points_grammar_type, iterator_type, svg_parse_context_type); +#endif }}} From b60de49388e46b93be40e8c78ab886da22d37f51 Mon Sep 17 00:00:00 2001 From: Artem Pavlenko Date: Mon, 21 Oct 2019 17:18:25 +0100 Subject: [PATCH 2/3] make sure boost 1_69 works too --- src/json/positions_grammar_x3.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/json/positions_grammar_x3.cpp b/src/json/positions_grammar_x3.cpp index fb9f96270..1b12ff440 100644 --- a/src/json/positions_grammar_x3.cpp +++ b/src/json/positions_grammar_x3.cpp @@ -31,12 +31,13 @@ BOOST_SPIRIT_INSTANTIATE(positions_grammar_type, iterator_type, context_type); BOOST_SPIRIT_INSTANTIATE(positions_grammar_type, iterator_type, feature_context_type); BOOST_SPIRIT_INSTANTIATE(positions_grammar_type, iterator_type, feature_context_const_type); -#if BOOST_VERSION >=107000 + BOOST_SPIRIT_INSTANTIATE(positions_grammar_type, iterator_type, extract_bounding_boxes_context_type); BOOST_SPIRIT_INSTANTIATE(positions_grammar_type, iterator_type, extract_bounding_boxes_reverse_context_type); BOOST_SPIRIT_INSTANTIATE(positions_grammar_type, iterator_type, extract_bounding_boxes_context_type_f); BOOST_SPIRIT_INSTANTIATE(positions_grammar_type, iterator_type, extract_bounding_boxes_reverse_context_type_f); -#else + +#if BOOST_VERSION < 107000 BOOST_SPIRIT_INSTANTIATE_UNUSED(positions_grammar_type, iterator_type, extract_bounding_boxes_context_type); BOOST_SPIRIT_INSTANTIATE_UNUSED(positions_grammar_type, iterator_type, extract_bounding_boxes_reverse_context_type); BOOST_SPIRIT_INSTANTIATE_UNUSED(positions_grammar_type, iterator_type, extract_bounding_boxes_context_type_f); From c9da5cbd8e563a6b06b3d72d9a883281d1531962 Mon Sep 17 00:00:00 2001 From: Artem Pavlenko Date: Mon, 21 Oct 2019 18:21:51 +0100 Subject: [PATCH 3/3] support for boost < 1.69 --- include/mapnik/json/feature_generator_grammar.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/mapnik/json/feature_generator_grammar.hpp b/include/mapnik/json/feature_generator_grammar.hpp index 6fb06cc9d..7bfbbc5e2 100644 --- a/include/mapnik/json/feature_generator_grammar.hpp +++ b/include/mapnik/json/feature_generator_grammar.hpp @@ -63,6 +63,7 @@ struct end_container } }; +#if BOOST_VERSION >= 106900 template <> struct transform_attribute : detail::transform_attribute_base @@ -73,7 +74,7 @@ struct transform_attribute : detail::transform_attribute_base, mapnik::feature_impl const&, boost::spirit::karma::domain> {}; - +#endif }}} namespace mapnik { namespace json {