diff --git a/SConstruct b/SConstruct index e49d993ad..330a445fe 100644 --- a/SConstruct +++ b/SConstruct @@ -1717,7 +1717,8 @@ if not preconfigured: # faster compile # http://www.boost.org/doc/libs/1_47_0/libs/spirit/doc/html/spirit/what_s_new/spirit_2_5.html#spirit.what_s_new.spirit_2_5.breaking_changes - env.Append(CPPDEFINES = '-DBOOST_SPIRIT_NO_PREDEFINED_TERMINALS=1 -DBOOST_PHOENIX_NO_PREDEFINED_TERMINALS=1') + env.Append(CPPDEFINES = '-DBOOST_SPIRIT_NO_PREDEFINED_TERMINALS=1') + env.Append(CPPDEFINES = '-DBOOST_PHOENIX_NO_PREDEFINED_TERMINALS=1') # c++11 support / https://github.com/mapnik/mapnik/issues/1683 # - upgrade to PHOENIX_V3 since that is needed for c++11 compile env.Append(CPPDEFINES = '-DBOOST_SPIRIT_USE_PHOENIX_V3=1') diff --git a/include/mapnik/css_color_grammar.hpp b/include/mapnik/css_color_grammar.hpp index e5dd849b1..7e7a3743b 100644 --- a/include/mapnik/css_color_grammar.hpp +++ b/include/mapnik/css_color_grammar.hpp @@ -440,13 +440,13 @@ struct css_color_grammar : qi::grammar : css_color_grammar::base_type(css_color) { - using qi::lit; - using qi::_val; - using qi::double_; - using qi::_1; - using qi::_a; - using qi::_b; - using qi::_c; + qi::lit_type lit; + qi::_val_type _val; + qi::double_type double_; + qi::_1_type _1; + qi::_a_type _a; + qi::_b_type _b; + qi::_c_type _c; using ascii::no_case; using phoenix::at_c; diff --git a/include/mapnik/css_color_grammar_impl.hpp b/include/mapnik/css_color_grammar_impl.hpp index 5b37f8761..1adbd1a61 100644 --- a/include/mapnik/css_color_grammar_impl.hpp +++ b/include/mapnik/css_color_grammar_impl.hpp @@ -38,14 +38,14 @@ css_color_grammar::css_color_grammar() : css_color_grammar::base_type(css_color) { - using qi::lit; - using qi::_val; - using qi::double_; - using qi::_1; - using qi::_a; - using qi::_b; - using qi::_c; - using ascii::no_case; + qi::lit_type lit; + qi::_val_type _val; + qi::double_type double_; + qi::_1_type _1; + qi::_a_type _a; + qi::_b_type _b; + qi::_c_type _c; + ascii::no_case_type no_case; using phoenix::at_c; css_color %= rgba_color diff --git a/include/mapnik/expression_grammar_impl.hpp b/include/mapnik/expression_grammar_impl.hpp index 2255d4856..c77275c63 100644 --- a/include/mapnik/expression_grammar_impl.hpp +++ b/include/mapnik/expression_grammar_impl.hpp @@ -72,21 +72,20 @@ expression_grammar::expression_grammar(mapnik::transcoder const& tr) regex_replace_(regex_replace_impl(tr)) { using boost::phoenix::construct; - using qi::_1; - using qi::_a; - using qi::_b; - using qi::_r1; + qi::_1_type _1; + qi::_a_type _a; + qi::_b_type _b; + qi::_r1_type _r1; #if BOOST_VERSION > 104200 - using qi::no_skip; + qi::no_skip_type no_skip; #endif - using qi::lexeme; - using qi::_val; - using qi::lit; - using qi::double_; - using qi::hex; - using qi::omit; - using standard_wide::char_; - using standard_wide::no_case; + qi::_val_type _val; + qi::lit_type lit; + qi::double_type double_; + qi::hex_type hex; + qi::omit_type omit; + standard_wide::char_type char_; + standard_wide::no_case_type no_case; expr = logical_expr.alias(); diff --git a/include/mapnik/json/feature_collection_grammar.hpp b/include/mapnik/json/feature_collection_grammar.hpp index da811a562..86d7a4a52 100644 --- a/include/mapnik/json/feature_collection_grammar.hpp +++ b/include/mapnik/json/feature_collection_grammar.hpp @@ -65,12 +65,14 @@ struct feature_collection_grammar : ctx_(ctx), generate_id_(1) { - using qi::lit; - using qi::eps; - using qi::_a; - using qi::_b; - using qi::_val; - using qi::_r1; + qi::lit_type lit; + qi::eps_type eps; + qi::_4_type _4; + qi::_3_type _2; + qi::_2_type _3; + qi::_a_type _a; + qi::_val_type _val; + qi::_r1_type _r1; using phoenix::push_back; using phoenix::construct; using phoenix::new_; @@ -114,9 +116,9 @@ struct feature_collection_grammar : feature_collection , std::clog << phoenix::val("Error parsing GeoJSON ") - << qi::_4 + << _4 << phoenix::val(" here: \"") - << construct(qi::_3, qi::_2) + << construct(_3, _2) << phoenix::val('\"') << std::endl ); diff --git a/include/mapnik/json/feature_generator_grammar.hpp b/include/mapnik/json/feature_generator_grammar.hpp index 7f24879ed..b16f9d99a 100644 --- a/include/mapnik/json/feature_generator_grammar.hpp +++ b/include/mapnik/json/feature_generator_grammar.hpp @@ -147,8 +147,11 @@ struct escaped_string escaped_string() : escaped_string::base_type(esc_str) { - using boost::spirit::karma::maxwidth; - using boost::spirit::karma::right_align; + karma::lit_type lit; + karma::_r1_type _r1; + karma::hex_type hex; + karma::right_align_type right_align; + karma::print_type kprint; esc_char.add ('"', "\\\"") @@ -160,11 +163,11 @@ struct escaped_string ('\t', "\\t") ; - esc_str = karma::lit(karma::_r1) + esc_str = lit(_r1) << *(esc_char - | karma::print - | "\\u" << right_align(4,karma::lit('0'))[karma::hex]) - << karma::lit(karma::_r1) + | kprint + | "\\u" << right_align(4,lit('0'))[hex]) + << lit(_r1) ; } @@ -185,15 +188,15 @@ struct feature_generator_grammar: , quote_("\"") { - using boost::spirit::karma::lit; - using boost::spirit::karma::uint_; - using boost::spirit::karma::bool_; - using boost::spirit::karma::double_; - using boost::spirit::karma::_val; - using boost::spirit::karma::_1; - using boost::spirit::karma::_r1; - using boost::spirit::karma::string; - using boost::spirit::karma::eps; + boost::spirit::karma::lit_type lit; + boost::spirit::karma::uint_type uint_; + boost::spirit::karma::bool_type bool_; + boost::spirit::karma::double_type double_; + boost::spirit::karma::_val_type _val; + boost::spirit::karma::_1_type _1; + boost::spirit::karma::_r1_type _r1; + boost::spirit::karma::string_type kstring; + boost::spirit::karma::eps_type eps; feature = lit("{\"type\":\"Feature\",\"id\":") << uint_[_1 = id_(_val)] @@ -208,7 +211,7 @@ struct feature_generator_grammar: ; pair = lit('"') - << string[_1 = phoenix::at_c<0>(_val)] << lit('"') + << kstring[_1 = phoenix::at_c<0>(_val)] << lit('"') << lit(':') << value(phoenix::at_c<1>(_val)) ; @@ -216,7 +219,7 @@ struct feature_generator_grammar: value = (value_null_| bool_ | int__ | double_ | ustring)[_1 = value_base_(_r1)] ; - value_null_ = string[_1 = "null"] + value_null_ = kstring[_1 = "null"] ; ustring = escaped_string_(quote_.c_str())[_1 = utf8_(_val)] diff --git a/include/mapnik/json/geometry_generator_grammar.hpp b/include/mapnik/json/geometry_generator_grammar.hpp index 68ce8ffed..8652a8db3 100644 --- a/include/mapnik/json/geometry_generator_grammar.hpp +++ b/include/mapnik/json/geometry_generator_grammar.hpp @@ -231,14 +231,15 @@ struct geometry_generator_grammar : geometry_generator_grammar() : geometry_generator_grammar::base_type(coordinates) { - using boost::spirit::karma::uint_; - using boost::spirit::bool_; - using boost::spirit::karma::_val; - using boost::spirit::karma::_1; - using boost::spirit::karma::lit; - using boost::spirit::karma::_a; - using boost::spirit::karma::_r1; - using boost::spirit::karma::eps; + boost::spirit::karma::uint_type uint_; + boost::spirit::bool_type bool_; + boost::spirit::karma::_val_type _val; + boost::spirit::karma::_1_type _1; + boost::spirit::karma::lit_type lit; + boost::spirit::karma::_a_type _a; + boost::spirit::karma::_r1_type _r1; + boost::spirit::karma::eps_type eps; + boost::spirit::karma::string_type kstring; coordinates = point | linestring | polygon ; @@ -266,7 +267,7 @@ struct geometry_generator_grammar : ; polygon_coord %= ( &uint_(mapnik::SEG_MOVETO) << eps[_r1 += 1] - << karma::string[ if_ (_r1 > 1) [_1 = "],["] + << kstring[ if_ (_r1 > 1) [_1 = "],["] .else_[_1 = '[' ]] | &uint_(mapnik::SEG_LINETO) @@ -308,13 +309,14 @@ struct multi_geometry_generator_grammar : multi_geometry_generator_grammar() : multi_geometry_generator_grammar::base_type(start) { - using boost::spirit::karma::lit; - using boost::spirit::karma::eps; - using boost::spirit::karma::_val; - using boost::spirit::karma::_1; - using boost::spirit::karma::_a; - using boost::spirit::karma::_r1; - using boost::spirit::bool_; + boost::spirit::karma::uint_type uint_; + boost::spirit::bool_type bool_; + boost::spirit::karma::_val_type _val; + boost::spirit::karma::_1_type _1; + boost::spirit::karma::lit_type lit; + boost::spirit::karma::_a_type _a; + boost::spirit::karma::eps_type eps; + boost::spirit::karma::string_type kstring; geometry_types.add (mapnik::geometry_type::types::Point,"\"Point\"") @@ -338,9 +340,9 @@ struct multi_geometry_generator_grammar : geometry = ( &bool_(true)[_1 = not_empty_(_val)] << lit("{\"type\":") << geometry_types[_1 = phoenix::at_c<0>(_a)][_a = multi_type_(_val)] << lit(",\"coordinates\":") - << karma::string[ phoenix::if_ (phoenix::at_c<0>(_a) > 3) [_1 = '['].else_[_1 = ""]] + << kstring[ phoenix::if_ (phoenix::at_c<0>(_a) > 3) [_1 = '['].else_[_1 = ""]] << coordinates - << karma::string[ phoenix::if_ (phoenix::at_c<0>(_a) > 3) [_1 = ']'].else_[_1 = ""]] + << kstring[ phoenix::if_ (phoenix::at_c<0>(_a) > 3) [_1 = ']'].else_[_1 = ""]] << lit('}')) | lit("null") ; diff --git a/include/mapnik/json/topojson_grammar_impl.hpp b/include/mapnik/json/topojson_grammar_impl.hpp index 092bca0f5..bf7f15f07 100644 --- a/include/mapnik/json/topojson_grammar_impl.hpp +++ b/include/mapnik/json/topojson_grammar_impl.hpp @@ -34,18 +34,18 @@ template topojson_grammar::topojson_grammar() : topojson_grammar::base_type(topology, "topojson") { - using qi::lit; - using qi::double_; - using qi::int_; - using qi::no_skip; - using qi::omit; - using qi::_val; - using qi::_1; - using qi::_2; - using qi::_3; - using qi::_4; - using qi::fail; - using qi::on_error; + qi::lit_type lit; + qi::double_type double_; + qi::int__type int_; + qi::no_skip_type no_skip; + qi::omit_type omit; + qi::_val_type _val; + qi::_1_type _1; + qi::_2_type _2; + qi::_3_type _3; + qi::_4_type _4; + qi::fail_type fail; + qi::on_error_type on_error; using standard_wide::char_; using phoenix::construct; diff --git a/include/mapnik/svg/output/svg_generator.hpp b/include/mapnik/svg/output/svg_generator.hpp index 30f077a42..2403336c0 100644 --- a/include/mapnik/svg/output/svg_generator.hpp +++ b/include/mapnik/svg/output/svg_generator.hpp @@ -64,6 +64,7 @@ namespace mapnik { namespace svg { template void generate_path(PathType const& path, path_output_attributes const& path_attributes) { + karma::lit_type lit; util::svg_generator svg_path_grammer; karma::generate(output_iterator_, lit(" svg_rect_attributes; @@ -163,16 +166,17 @@ struct svg_root_attributes_grammar : karma::grammar #include #include diff --git a/include/mapnik/svg/svg_path_grammar.hpp b/include/mapnik/svg/svg_path_grammar.hpp index 851a501c2..74c935828 100644 --- a/include/mapnik/svg/svg_path_grammar.hpp +++ b/include/mapnik/svg/svg_path_grammar.hpp @@ -53,16 +53,16 @@ namespace mapnik { namespace svg { arc_to_(arc_to(path)), close_(close(path)) { - using qi::_1; - using qi::_2; - using qi::_3; - using qi::_4; - using qi::_5; - using qi::_a; - using qi::lit; - using qi::double_; - using qi::int_; - using qi::no_case; + qi::_1_type _1; + qi::_2_type _2; + qi::_3_type _3; + qi::_4_type _4; + qi::_5_type _5; + qi::_a_type _a; + qi::lit_type lit; + qi::double_type double_; + qi::int_type int_; + qi::no_case_type no_case; start = +cmd; cmd = M >> *drawto_cmd; diff --git a/include/mapnik/svg/svg_points_grammar.hpp b/include/mapnik/svg/svg_points_grammar.hpp index 9fe061e27..ffc41292e 100644 --- a/include/mapnik/svg/svg_points_grammar.hpp +++ b/include/mapnik/svg/svg_points_grammar.hpp @@ -45,9 +45,9 @@ namespace mapnik { namespace svg { line_to_(line_to(path)), close_(close(path)) { - using qi::_1; - using qi::_2; - using qi::double_; + qi::_1_type _1; + qi::lit_type lit; + qi::double_type double_; start = coord[move_to_(_1,false)] // move_to >> *(-lit(',') >> coord [ line_to_(_1,false) ] ); // *line_to diff --git a/include/mapnik/svg/svg_transform_grammar.hpp b/include/mapnik/svg/svg_transform_grammar.hpp index a63884bfb..bbc43e661 100644 --- a/include/mapnik/svg/svg_transform_grammar.hpp +++ b/include/mapnik/svg/svg_transform_grammar.hpp @@ -207,18 +207,18 @@ namespace mapnik { namespace svg { scale_action(process_scale(tr)), skew_action(process_skew(tr)) { - using qi::_1; - using qi::_2; - using qi::_3; - using qi::_4; - using qi::_5; - using qi::_6; - using qi::_a; - using qi::_b; - using qi::_c; - using qi::_val; - using qi::double_; - using qi::no_case; + qi::_1_type _1; + qi::_2_type _2; + qi::_3_type _3; + qi::_4_type _4; + qi::_5_type _5; + qi::_6_type _6; + qi::_a_type _a; + qi::_b_type _b; + qi::_c_type _c; + qi::lit_type lit; + qi::double_type double_; + qi::no_case_type no_case; start = +transform_ ; diff --git a/include/mapnik/util/dasharray_parser.hpp b/include/mapnik/util/dasharray_parser.hpp index a422b53d1..ee4f1301e 100644 --- a/include/mapnik/util/dasharray_parser.hpp +++ b/include/mapnik/util/dasharray_parser.hpp @@ -33,22 +33,22 @@ namespace mapnik { namespace util { template bool parse_dasharray(Iterator first, Iterator last, std::vector& dasharray) { - using qi::double_; - using qi::phrase_parse; - using qi::_1; - using qi::lit; - using qi::char_; + qi::double_type double_; + qi::_1_type _1; + qi::lit_type lit; + qi::char_type char_; + qi::ascii::space_type space; #if BOOST_VERSION > 104200 - using qi::no_skip; + qi::no_skip_type no_skip; #else - using qi::lexeme; + qi::lexeme_type lexeme; #endif using phoenix::push_back; // SVG // dasharray ::= (length | percentage) (comma-wsp dasharray)? // no support for 'percentage' as viewport is unknown at load_map // - bool r = phrase_parse(first, last, + bool r = qi::phrase_parse(first, last, (double_[push_back(phoenix::ref(dasharray), _1)] % #if BOOST_VERSION > 104200 no_skip[char_(", ")] @@ -56,7 +56,7 @@ bool parse_dasharray(Iterator first, Iterator last, std::vector& dasharr lexeme[char_(", ")] #endif | lit("none")), - qi::ascii::space); + space); if (first != last) { return false; diff --git a/include/mapnik/util/geometry_svg_generator.hpp b/include/mapnik/util/geometry_svg_generator.hpp index 68bca1135..659427312 100644 --- a/include/mapnik/util/geometry_svg_generator.hpp +++ b/include/mapnik/util/geometry_svg_generator.hpp @@ -166,11 +166,12 @@ namespace mapnik { namespace util { svg_generator() : svg_generator::base_type(svg) { - using boost::spirit::karma::uint_; - using boost::spirit::karma::_val; - using boost::spirit::karma::_1; - using boost::spirit::karma::lit; - using boost::spirit::karma::_a; + boost::spirit::karma::uint_type uint_; + boost::spirit::karma::_val_type _val; + boost::spirit::karma::_1_type _1; + boost::spirit::karma::lit_type lit; + boost::spirit::karma::_a_type _a; + boost::spirit::karma::string_type kstring; svg = point | linestring | polygon ; @@ -194,7 +195,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" ].else_[_1 =""]]) + | &uint_(mapnik::SEG_LINETO) [_a +=1] << kstring [if_(_a == 1) [_1 = "L" ].else_[_1 =""]]) << lit(' ') << coordinate << lit(' ') << coordinate) % lit(' ') ; diff --git a/include/mapnik/wkt/wkt_grammar.hpp b/include/mapnik/wkt/wkt_grammar.hpp index 09d634531..0e20138b5 100644 --- a/include/mapnik/wkt/wkt_grammar.hpp +++ b/include/mapnik/wkt/wkt_grammar.hpp @@ -99,9 +99,17 @@ namespace mapnik { namespace wkt { wkt_grammar() : wkt_grammar::base_type(geometry_tagged_text) { - using qi::no_case; - using qi::_1; - using qi::_2; + qi::_r1_type _r1; + qi::_r2_type _r2; + qi::_pass_type _pass; + qi::eps_type eps; + qi::_val_type _val; + qi::lit_type lit; + qi::no_case_type no_case; + qi::double_type double_; + qi::_1_type _1; + qi::_2_type _2; + qi::_a_type _a; using boost::phoenix::push_back; geometry_tagged_text = point_tagged_text @@ -223,9 +231,8 @@ struct wkt_collection_grammar : qi::grammar> (lit("(") >> wkt % lit(",") >> lit(")")); diff --git a/plugins/input/shape/dbfile.cpp b/plugins/input/shape/dbfile.cpp index 9d32c35b8..dd5b3478e 100644 --- a/plugins/input/shape/dbfile.cpp +++ b/plugins/input/shape/dbfile.cpp @@ -184,16 +184,24 @@ void dbf_file::add_attribute(int col, mapnik::transcoder const& tr, mapnik::feat double val = 0.0; const char *itr = record_+fields_[col].offset_; const char *end = itr + fields_[col].length_; - if (qi::phrase_parse(itr,end,double_,ascii::space,val)) + ascii::space_type space; + qi::double_type double_; + if (qi::phrase_parse(itr,end,double_,space,val)) + { f.put(name,val); + } } else { mapnik::value_integer val = 0; const char *itr = record_+fields_[col].offset_; const char *end = itr + fields_[col].length_; - if (qi::phrase_parse(itr,end,int_,ascii::space,val)) + ascii::space_type space; + qi::int_type int_; + if (qi::phrase_parse(itr,end,int_,space,val)) + { f.put(name,val); + } } break; } diff --git a/tests/cpp_tests/svg_renderer_tests/background_color_test.cpp b/tests/cpp_tests/svg_renderer_tests/background_color_test.cpp index 7ff205836..917b9d43c 100644 --- a/tests/cpp_tests/svg_renderer_tests/background_color_test.cpp +++ b/tests/cpp_tests/svg_renderer_tests/background_color_test.cpp @@ -1,3 +1,5 @@ +#undef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS + #define BOOST_TEST_MODULE background_color_test /* diff --git a/tests/cpp_tests/svg_renderer_tests/combined_test.cpp b/tests/cpp_tests/svg_renderer_tests/combined_test.cpp index ccc06a3e3..11b266475 100644 --- a/tests/cpp_tests/svg_renderer_tests/combined_test.cpp +++ b/tests/cpp_tests/svg_renderer_tests/combined_test.cpp @@ -1,3 +1,4 @@ +#undef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS #define BOOST_TEST_MODULE combined_tests // boost.test diff --git a/tests/cpp_tests/svg_renderer_tests/compilation_test.cpp b/tests/cpp_tests/svg_renderer_tests/compilation_test.cpp index e1356a4ab..2faaf91e1 100644 --- a/tests/cpp_tests/svg_renderer_tests/compilation_test.cpp +++ b/tests/cpp_tests/svg_renderer_tests/compilation_test.cpp @@ -1,3 +1,4 @@ +#undef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS #define BOOST_TEST_MODULE compile_test // boost.test diff --git a/tests/cpp_tests/svg_renderer_tests/file_output_test.cpp b/tests/cpp_tests/svg_renderer_tests/file_output_test.cpp index d460be3c2..eb08543c5 100644 --- a/tests/cpp_tests/svg_renderer_tests/file_output_test.cpp +++ b/tests/cpp_tests/svg_renderer_tests/file_output_test.cpp @@ -1,3 +1,4 @@ +#undef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS #define BOOST_TEST_MODULE file_output_test /* diff --git a/tests/cpp_tests/svg_renderer_tests/path_element_test.cpp b/tests/cpp_tests/svg_renderer_tests/path_element_test.cpp index 9b99b981a..c80dd760c 100644 --- a/tests/cpp_tests/svg_renderer_tests/path_element_test.cpp +++ b/tests/cpp_tests/svg_renderer_tests/path_element_test.cpp @@ -1,3 +1,4 @@ +#undef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS #define BOOST_TEST_MODULE path_element_tests // boost.test diff --git a/tests/cpp_tests/svg_renderer_tests/root_element_test.cpp b/tests/cpp_tests/svg_renderer_tests/root_element_test.cpp index a3c2c4275..a9f491eab 100644 --- a/tests/cpp_tests/svg_renderer_tests/root_element_test.cpp +++ b/tests/cpp_tests/svg_renderer_tests/root_element_test.cpp @@ -1,3 +1,4 @@ +#undef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS #define BOOST_TEST_MODULE root_element_test /*