diff --git a/SConstruct b/SConstruct index 3e069faa2..e49d993ad 100644 --- a/SConstruct +++ b/SConstruct @@ -1715,6 +1715,9 @@ if not preconfigured: debug_defines = ['-DDEBUG', '-DMAPNIK_DEBUG'] ndebug_defines = ['-DNDEBUG'] + # 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') # 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/src/box2d.cpp b/src/box2d.cpp index 3af4d1df2..b4cea771d 100644 --- a/src/box2d.cpp +++ b/src/box2d.cpp @@ -342,9 +342,9 @@ void box2d::pad(T padding) template bool box2d::from_string(std::string const& str) { - using boost::spirit::qi::lit; - using boost::spirit::qi::double_; - using boost::spirit::ascii::space; + boost::spirit::qi::lit_type lit; + boost::spirit::qi::double_type double_; + boost::spirit::ascii::space_type space; bool r = boost::spirit::qi::phrase_parse(str.begin(), str.end(), double_ >> -lit(',') >> double_ >> -lit(',') diff --git a/src/color.cpp b/src/color.cpp index 65f178825..7243a240c 100644 --- a/src/color.cpp +++ b/src/color.cpp @@ -44,20 +44,20 @@ color::color(std::string const& str) std::string color::to_string() const { namespace karma = boost::spirit::karma; - using boost::spirit::karma::_1; - using boost::spirit::karma::eps; - using boost::spirit::karma::double_; - using boost::spirit::karma::string; + boost::spirit::karma::_1_type _1; + boost::spirit::karma::eps_type eps; + boost::spirit::karma::double_type double_; + boost::spirit::karma::string_type kstring; boost::spirit::karma::uint_generator color_generator; std::string str; std::back_insert_iterator sink(str); karma::generate(sink, // begin grammar - string[ phoenix::if_(alpha()==255) [_1="rgb("].else_[_1="rgba("]] + kstring[ phoenix::if_(alpha()==255) [_1="rgb("].else_[_1="rgba("]] << color_generator[_1 = red()] << ',' << color_generator[_1 = green()] << ',' << color_generator[_1 = blue()] - << string[ phoenix::if_(alpha()==255) [_1 = ')'].else_[_1 =',']] + << kstring[ phoenix::if_(alpha()==255) [_1 = ')'].else_[_1 =',']] << eps(alpha()<255) << double_ [_1 = alpha()/255.0] << ')' // end grammar @@ -68,10 +68,10 @@ std::string color::to_string() const std::string color::to_hex_string() const { namespace karma = boost::spirit::karma; - using boost::spirit::karma::_1; - using boost::spirit::karma::hex; - using boost::spirit::karma::eps; - using boost::spirit::karma::right_align; + boost::spirit::karma::_1_type _1; + boost::spirit::karma::hex_type hex; + boost::spirit::karma::eps_type eps; + boost::spirit::karma::right_align_type right_align; std::string str; std::back_insert_iterator sink(str); karma::generate(sink, diff --git a/src/color_factory.cpp b/src/color_factory.cpp index 5ede3e60e..3199ed971 100644 --- a/src/color_factory.cpp +++ b/src/color_factory.cpp @@ -29,10 +29,6 @@ // boost #include -// stl -#include - - namespace mapnik { color parse_color(std::string const& str) @@ -45,19 +41,18 @@ color parse_color(std::string const& str, css_color_grammar const& g) { color c; - std::string::const_iterator first = str.begin(); std::string::const_iterator last = str.end(); - + boost::spirit::ascii::space_type space; // boost 1.41 -> 1.44 compatibility, to be removed in mapnik 2.1 (dane) #if BOOST_VERSION >= 104500 bool result = boost::spirit::qi::phrase_parse(first, last, g, - boost::spirit::ascii::space, + space, c); #else mapnik::css css_; bool result = boost::spirit::qi::phrase_parse(first, last, g, - boost::spirit::ascii::space, + space, css_); c.set_red(css_.r); c.set_green(css_.g); @@ -67,9 +62,13 @@ color parse_color(std::string const& str, #endif if (result && (first == last)) + { return c; + } else + { throw config_error( "Failed to parse color: \"" + str + "\"" ); + } } } diff --git a/src/conversions.cpp b/src/conversions.cpp index c4abfff54..5e7353cc0 100644 --- a/src/conversions.cpp +++ b/src/conversions.cpp @@ -58,12 +58,12 @@ namespace util { using namespace boost::spirit; -BOOST_SPIRIT_AUTO(qi, INTEGER, qi::int_) +BOOST_SPIRIT_AUTO(qi, INTEGER, qi::int_type()) #ifdef BIGINT -BOOST_SPIRIT_AUTO(qi, LONGLONG, qi::long_long) +BOOST_SPIRIT_AUTO(qi, LONGLONG, qi::long_long_type()) #endif -BOOST_SPIRIT_AUTO(qi, FLOAT, qi::float_) -BOOST_SPIRIT_AUTO(qi, DOUBLE, qi::double_) +BOOST_SPIRIT_AUTO(qi, FLOAT, qi::float_type()) +BOOST_SPIRIT_AUTO(qi, DOUBLE, qi::double_type()) struct bool_symbols : qi::symbols { @@ -82,75 +82,85 @@ struct bool_symbols : qi::symbols bool string2bool(const char * iter, const char * end, bool & result) { - using boost::spirit::qi::no_case; - bool r = qi::phrase_parse(iter,end, no_case[bool_symbols()] ,ascii::space,result); + boost::spirit::qi::no_case_type no_case; + ascii::space_type space; + bool r = qi::phrase_parse(iter,end,no_case[bool_symbols()],space,result); return r && (iter == end); } bool string2bool(std::string const& value, bool & result) { - using boost::spirit::qi::no_case; + boost::spirit::qi::no_case_type no_case; + ascii::space_type space; std::string::const_iterator str_beg = value.begin(); std::string::const_iterator str_end = value.end(); - bool r = qi::phrase_parse(str_beg,str_end,no_case[bool_symbols()],ascii::space,result); + bool r = qi::phrase_parse(str_beg,str_end,no_case[bool_symbols()],space,result); return r && (str_beg == str_end); } bool string2int(const char * iter, const char * end, int & result) { - bool r = qi::phrase_parse(iter,end,INTEGER,ascii::space,result); + ascii::space_type space; + bool r = qi::phrase_parse(iter,end,INTEGER,space,result); return r && (iter == end); } bool string2int(std::string const& value, int & result) { + ascii::space_type space; std::string::const_iterator str_beg = value.begin(); std::string::const_iterator str_end = value.end(); - bool r = qi::phrase_parse(str_beg,str_end,INTEGER,ascii::space,result); + bool r = qi::phrase_parse(str_beg,str_end,INTEGER,space,result); return r && (str_beg == str_end); } #ifdef BIGINT bool string2int(const char * iter, const char * end, mapnik::value_integer & result) { - bool r = qi::phrase_parse(iter,end,LONGLONG,ascii::space,result); + ascii::space_type space; + bool r = qi::phrase_parse(iter,end,LONGLONG,space,result); return r && (iter == end); } bool string2int(std::string const& value, mapnik::value_integer & result) { + ascii::space_type space; std::string::const_iterator str_beg = value.begin(); std::string::const_iterator str_end = value.end(); - bool r = qi::phrase_parse(str_beg,str_end,LONGLONG,ascii::space,result); + bool r = qi::phrase_parse(str_beg,str_end,LONGLONG,space,result); return r && (str_beg == str_end); } #endif bool string2double(std::string const& value, double & result) { + ascii::space_type space; std::string::const_iterator str_beg = value.begin(); std::string::const_iterator str_end = value.end(); - bool r = qi::phrase_parse(str_beg,str_end,DOUBLE,ascii::space,result); + bool r = qi::phrase_parse(str_beg,str_end,DOUBLE,space,result); return r && (str_beg == str_end); } bool string2double(const char * iter, const char * end, double & result) { - bool r = qi::phrase_parse(iter,end,DOUBLE,ascii::space,result); + ascii::space_type space; + bool r = qi::phrase_parse(iter,end,DOUBLE,space,result); return r && (iter == end); } bool string2float(std::string const& value, float & result) { + ascii::space_type space; std::string::const_iterator str_beg = value.begin(); std::string::const_iterator str_end = value.end(); - bool r = qi::phrase_parse(str_beg,str_end,FLOAT,ascii::space,result); + bool r = qi::phrase_parse(str_beg,str_end,FLOAT,space,result); return r && (str_beg == str_end); } bool string2float(const char * iter, const char * end, float & result) { - bool r = qi::phrase_parse(iter,end,FLOAT,ascii::space,result); + ascii::space_type space; + bool r = qi::phrase_parse(iter,end,FLOAT,space,result); return r && (iter == end); } diff --git a/src/expression.cpp b/src/expression.cpp index 49efb0d83..7436c2dc6 100644 --- a/src/expression.cpp +++ b/src/expression.cpp @@ -43,10 +43,11 @@ expression_ptr parse_expression(std::string const& str, std::string const& encod expression_ptr parse_expression(std::string const& str, mapnik::expression_grammar const& g) { + boost::spirit::standard_wide::space_type space; expression_ptr node = std::make_shared(); std::string::const_iterator itr = str.begin(); std::string::const_iterator end = str.end(); - bool r = boost::spirit::qi::phrase_parse(itr, end, g, boost::spirit::standard_wide::space, *node); + bool r = boost::spirit::qi::phrase_parse(itr, end, g, space, *node); if (r && itr == end) { return node; diff --git a/src/feature_style_processor.cpp b/src/feature_style_processor.cpp index fd79e13a7..8b937c25b 100644 --- a/src/feature_style_processor.cpp +++ b/src/feature_style_processor.cpp @@ -21,6 +21,16 @@ *****************************************************************************/ // mapnik +#if defined(SVG_RENDERER) +// FIXME: workaround incompatibility of karma with -DBOOST_SPIRIT_NO_PREDEFINED_TERMINALS=1 +/* +boost/spirit/repository/home/karma/directive/confix.hpp:49:23: error: no member named + 'confix' in namespace 'boost::spirit::repository' + using repository::confix; +*/ +#undef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS +#endif + #include #include #include diff --git a/src/image_filter_grammar.cpp b/src/image_filter_grammar.cpp index f54e184be..9362c6ae8 100644 --- a/src/image_filter_grammar.cpp +++ b/src/image_filter_grammar.cpp @@ -38,28 +38,26 @@ template image_filter_grammar::image_filter_grammar() : image_filter_grammar::base_type(start) { - using qi::lit; - using qi::_val; - using qi::_1; - using qi::_a; - using qi::_b; - using qi::_c; - using qi::_d; - using qi::_e; - using qi::_f; - using qi::_g; - using qi::_h; - using qi::_r1; - using qi::eps; - using qi::char_; - using qi::lexeme; - using qi::double_; - using boost::spirit::ascii::string; + qi::lit_type lit; + qi::_val_type _val; + qi::_1_type _1; + qi::_a_type _a; + qi::_b_type _b; + qi::_c_type _c; + qi::_d_type _d; + qi::_e_type _e; + qi::_f_type _f; + qi::_g_type _g; + qi::_h_type _h; + qi::_r1_type _r1; + qi::eps_type eps; + qi::char_type char_; + qi::double_type double_; using phoenix::push_back; using phoenix::construct; using phoenix::at_c; #if BOOST_VERSION >= 104700 - using qi::no_skip; + qi::no_skip_type no_skip; start = -(filter % no_skip[*char_(", ")]) ; #else diff --git a/src/image_filter_types.cpp b/src/image_filter_types.cpp index 9ffa0ad91..27d968fce 100644 --- a/src/image_filter_types.cpp +++ b/src/image_filter_types.cpp @@ -36,7 +36,7 @@ namespace filter { bool generate_image_filters(std::back_insert_iterator& sink, std::vector const& filters) { - using boost::spirit::karma::stream; + boost::spirit::karma::stream_type stream; using boost::spirit::karma::generate; bool r = generate(sink, stream % ' ', filters); return r; @@ -48,9 +48,10 @@ bool parse_image_filters(std::string const& filters, std::vector& i std::string::const_iterator end = filters.end(); mapnik::image_filter_grammar > filter_grammar; + boost::spirit::qi::ascii::space_type space; bool r = boost::spirit::qi::phrase_parse(itr,end, filter_grammar, - boost::spirit::qi::ascii::space, + space, image_filters); return r && itr==end; } diff --git a/src/json/feature_collection_parser.cpp b/src/json/feature_collection_parser.cpp index 8ff3ff27a..9ea228070 100644 --- a/src/json/feature_collection_parser.cpp +++ b/src/json/feature_collection_parser.cpp @@ -59,7 +59,8 @@ namespace mapnik { namespace json { { #if BOOST_VERSION >= 104700 using namespace boost::spirit; - return qi::phrase_parse(first, last, *grammar_, standard_wide::space, features); + standard_wide::space_type space; + return qi::phrase_parse(first, last, *grammar_, space, features); #else std::ostringstream s; s << BOOST_VERSION/100000 << "." << BOOST_VERSION/100 % 1000 << "." << BOOST_VERSION % 100; diff --git a/src/json/feature_grammar.cpp b/src/json/feature_grammar.cpp index 4002b84ae..ae1eac7ad 100644 --- a/src/json/feature_grammar.cpp +++ b/src/json/feature_grammar.cpp @@ -38,30 +38,26 @@ feature_grammar::feature_grammar(generic_json & json_(json), put_property_(put_property(tr)) { - using qi::lit; - using qi::long_long; - using qi::double_; + qi::lit_type lit; + qi::long_long_type long_long; + qi::double_type double_; #if BOOST_VERSION > 104200 - using qi::no_skip; + qi::no_skip_type no_skip; #else - using qi::lexeme; + qi::lexeme_type lexeme; #endif - using standard_wide::char_; - using qi::_val; - using qi::_1; - using qi::_2; - using qi::_3; - using qi::_4; - using qi::_a; - using qi::_b; - using qi::_r1; - using qi::_r2; + standard_wide::char_type char_; + qi::_val_type _val; + qi::_1_type _1; + qi::_2_type _2; + qi::_3_type _3; + qi::_4_type _4; + qi::_a_type _a; + qi::_r1_type _r1; + qi::eps_type eps; + using qi::fail; using qi::on_error; - using qi::_pass; - using qi::eps; - using qi::raw; - using phoenix::new_; using phoenix::push_back; using phoenix::construct; diff --git a/src/json/feature_parser.cpp b/src/json/feature_parser.cpp index 95d561125..ad123bcb7 100644 --- a/src/json/feature_parser.cpp +++ b/src/json/feature_parser.cpp @@ -47,7 +47,8 @@ namespace mapnik { namespace json { { #if BOOST_VERSION >= 104700 using namespace boost::spirit; - return qi::phrase_parse(first, last, (*grammar_)(boost::phoenix::ref(f)), standard_wide::space); + standard_wide::space_type space; + return qi::phrase_parse(first, last, (*grammar_)(boost::phoenix::ref(f)), space); #else std::ostringstream s; s << BOOST_VERSION/100000 << "." << BOOST_VERSION/100 % 1000 << "." << BOOST_VERSION % 100; diff --git a/src/json/geometry_grammar.cpp b/src/json/geometry_grammar.cpp index 7708ab17c..fcd400aef 100644 --- a/src/json/geometry_grammar.cpp +++ b/src/json/geometry_grammar.cpp @@ -41,20 +41,18 @@ geometry_grammar::geometry_grammar() : geometry_grammar::base_type(geometry,"geometry") { - using qi::lit; - using qi::int_; - using qi::double_; - using qi::_val; - using qi::_1; - using qi::_2; - using qi::_3; - using qi::_4; - using qi::_a; - using qi::_b; - using qi::_r1; - using qi::_r2; - using qi::eps; - using qi::_pass; + qi::lit_type lit; + qi::int_type int_; + qi::double_type double_; + qi::_1_type _1; + qi::_2_type _2; + qi::_3_type _3; + qi::_4_type _4; + qi::_a_type _a; + qi::_r1_type _r1; + qi::_r2_type _r2; + qi::eps_type eps; + qi::_pass_type _pass; using qi::fail; using qi::on_error; using boost::phoenix::new_; diff --git a/src/json/geometry_parser.cpp b/src/json/geometry_parser.cpp index f88177765..507a15782 100644 --- a/src/json/geometry_parser.cpp +++ b/src/json/geometry_parser.cpp @@ -50,7 +50,8 @@ bool geometry_parser::parse(iterator_type first, iterator_type last, b { #if BOOST_VERSION >= 104700 using namespace boost::spirit; - return qi::phrase_parse(first, last, (*grammar_)(boost::phoenix::ref(path)), standard_wide::space); + standard_wide::space_type space; + return qi::phrase_parse(first, last, (*grammar_)(boost::phoenix::ref(path)), space); #else std::ostringstream s; s << BOOST_VERSION/100000 << "." << BOOST_VERSION/100 % 1000 << "." << BOOST_VERSION % 100; diff --git a/src/load_map.cpp b/src/load_map.cpp index bca484fb4..f60c2daa8 100644 --- a/src/load_map.cpp +++ b/src/load_map.cpp @@ -471,9 +471,10 @@ void map_parser::parse_style(Map & map, xml_node const& sty) std::string filter_str = *direct_filters; std::string::const_iterator itr = filter_str.begin(); std::string::const_iterator end = filter_str.end(); + boost::spirit::qi::ascii::space_type space; bool result = boost::spirit::qi::phrase_parse(itr,end, sty.get_tree().image_filters_grammar, - boost::spirit::qi::ascii::space, + space, style.direct_image_filters()); if (!result || itr!=end) { diff --git a/src/parse_path.cpp b/src/parse_path.cpp index 214511114..26340988c 100644 --- a/src/parse_path.cpp +++ b/src/parse_path.cpp @@ -48,10 +48,10 @@ path_expression_ptr parse_path(std::string const& str, path_expression_grammar const& g) { path_expression path; - + boost::spirit::standard_wide::space_type space; std::string::const_iterator itr = str.begin(); std::string::const_iterator end = str.end(); - bool r = qi::phrase_parse(itr, end, g, boost::spirit::standard_wide::space, path); + bool r = qi::phrase_parse(itr, end, g, space, path); if (r && itr == end) { return std::make_shared(path); //path; diff --git a/src/path_expression_grammar.cpp b/src/path_expression_grammar.cpp index 048e5bf7f..0a3d92a2d 100644 --- a/src/path_expression_grammar.cpp +++ b/src/path_expression_grammar.cpp @@ -36,13 +36,13 @@ template path_expression_grammar::path_expression_grammar() : path_expression_grammar::base_type(expr) { - using boost::phoenix::construct; - using standard_wide::char_; - using qi::_1; - using qi::_val; - using qi::lit; - using qi::lexeme; + standard_wide::char_type char_; + qi::_1_type _1; + qi::_val_type _val; + qi::lit_type lit; + qi::lexeme_type lexeme; using phoenix::push_back; + using boost::phoenix::construct; expr = * ( diff --git a/src/svg/output/process_building_symbolizer.cpp b/src/svg/output/process_building_symbolizer.cpp index 23f602b17..e316998c6 100644 --- a/src/svg/output/process_building_symbolizer.cpp +++ b/src/svg/output/process_building_symbolizer.cpp @@ -21,6 +21,7 @@ *****************************************************************************/ // mapnik +#undef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS #include namespace mapnik diff --git a/src/svg/output/process_line_pattern_symbolizer.cpp b/src/svg/output/process_line_pattern_symbolizer.cpp index 42156c1d2..dd2db4560 100644 --- a/src/svg/output/process_line_pattern_symbolizer.cpp +++ b/src/svg/output/process_line_pattern_symbolizer.cpp @@ -21,6 +21,7 @@ *****************************************************************************/ // mapnik +#undef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS #include namespace mapnik diff --git a/src/svg/output/process_line_symbolizer.cpp b/src/svg/output/process_line_symbolizer.cpp index 6f2008408..9c8192b2a 100644 --- a/src/svg/output/process_line_symbolizer.cpp +++ b/src/svg/output/process_line_symbolizer.cpp @@ -21,6 +21,7 @@ *****************************************************************************/ // mapnik +#undef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS #include namespace mapnik diff --git a/src/svg/output/process_markers_symbolizer.cpp b/src/svg/output/process_markers_symbolizer.cpp index 67c1fe5ed..61e4c3e8b 100644 --- a/src/svg/output/process_markers_symbolizer.cpp +++ b/src/svg/output/process_markers_symbolizer.cpp @@ -21,6 +21,7 @@ *****************************************************************************/ // mapnik +#undef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS #include namespace mapnik diff --git a/src/svg/output/process_point_symbolizer.cpp b/src/svg/output/process_point_symbolizer.cpp index b737bf37e..1fc26a6c1 100644 --- a/src/svg/output/process_point_symbolizer.cpp +++ b/src/svg/output/process_point_symbolizer.cpp @@ -21,6 +21,7 @@ *****************************************************************************/ // mapnik +#undef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS #include namespace mapnik diff --git a/src/svg/output/process_polygon_pattern_symbolizer.cpp b/src/svg/output/process_polygon_pattern_symbolizer.cpp index f164044a9..c47357d4e 100644 --- a/src/svg/output/process_polygon_pattern_symbolizer.cpp +++ b/src/svg/output/process_polygon_pattern_symbolizer.cpp @@ -21,6 +21,7 @@ *****************************************************************************/ // mapnik +#undef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS #include namespace mapnik diff --git a/src/svg/output/process_polygon_symbolizer.cpp b/src/svg/output/process_polygon_symbolizer.cpp index 43ca9bdf8..c45b6188e 100644 --- a/src/svg/output/process_polygon_symbolizer.cpp +++ b/src/svg/output/process_polygon_symbolizer.cpp @@ -21,6 +21,7 @@ *****************************************************************************/ // mapnik +#undef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS #include namespace mapnik diff --git a/src/svg/output/process_raster_symbolizer.cpp b/src/svg/output/process_raster_symbolizer.cpp index a659fe58f..c4a07acd4 100644 --- a/src/svg/output/process_raster_symbolizer.cpp +++ b/src/svg/output/process_raster_symbolizer.cpp @@ -21,6 +21,7 @@ *****************************************************************************/ // mapnik +#undef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS #include namespace mapnik diff --git a/src/svg/output/process_shield_symbolizer.cpp b/src/svg/output/process_shield_symbolizer.cpp index 1fa981db6..04cdd230f 100644 --- a/src/svg/output/process_shield_symbolizer.cpp +++ b/src/svg/output/process_shield_symbolizer.cpp @@ -21,6 +21,7 @@ *****************************************************************************/ // mapnik +#undef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS #include namespace mapnik diff --git a/src/svg/output/process_symbolizers.cpp b/src/svg/output/process_symbolizers.cpp index 10de95982..5f765e140 100644 --- a/src/svg/output/process_symbolizers.cpp +++ b/src/svg/output/process_symbolizers.cpp @@ -21,6 +21,7 @@ *****************************************************************************/ // mapnik +#undef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS #include namespace mapnik { diff --git a/src/svg/output/process_text_symbolizer.cpp b/src/svg/output/process_text_symbolizer.cpp index 45bc8bf3b..356b085d0 100644 --- a/src/svg/output/process_text_symbolizer.cpp +++ b/src/svg/output/process_text_symbolizer.cpp @@ -21,6 +21,7 @@ *****************************************************************************/ // mapnik +#undef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS #include namespace mapnik diff --git a/src/svg/output/svg_generator.cpp b/src/svg/output/svg_generator.cpp index e5e2f7a84..d705ef378 100644 --- a/src/svg/output/svg_generator.cpp +++ b/src/svg/output/svg_generator.cpp @@ -21,6 +21,7 @@ *****************************************************************************/ // mapnik +#undef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS #include #include #include @@ -42,6 +43,7 @@ namespace mapnik { namespace svg { template void svg_generator::generate_header() { + karma::lit_type lit; karma::generate(output_iterator_, lit("\n")); karma::generate(output_iterator_, lit("\n")); } @@ -50,12 +52,14 @@ namespace mapnik { namespace svg { void svg_generator::generate_opening_root(root_output_attributes const& root_attributes) { root_attributes_grammar attributes_grammar; + karma::lit_type lit; karma::generate(output_iterator_, lit("\n"), root_attributes); } template void svg_generator::generate_closing_root() { + karma::lit_type lit; karma::generate(output_iterator_, lit("")); } @@ -63,6 +67,7 @@ namespace mapnik { namespace svg { void svg_generator::generate_rect(rect_output_attributes const& rect_attributes) { rect_attributes_grammar attributes_grammar; + karma::lit_type lit; karma::generate(output_iterator_, lit("\n"), rect_attributes); } @@ -70,6 +75,7 @@ namespace mapnik { namespace svg { void svg_generator::generate_opening_group(mapnik::value_integer val) { std::string string_val; + karma::lit_type lit; mapnik::util::to_string(string_val,val); karma::generate(output_iterator_, lit(" void svg_generator::generate_opening_group(std::string const& val) { + karma::lit_type lit; karma::generate(output_iterator_, lit(" void svg_generator::generate_closing_group() { + karma::lit_type lit; karma::generate(output_iterator_, lit("\n")); } diff --git a/src/svg/output/svg_output_attributes.cpp b/src/svg/output/svg_output_attributes.cpp index 544b280ad..9288e6567 100644 --- a/src/svg/output/svg_output_attributes.cpp +++ b/src/svg/output/svg_output_attributes.cpp @@ -22,6 +22,7 @@ *****************************************************************************/ // mapnik +#undef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS #include namespace mapnik { namespace svg { diff --git a/src/svg/output/svg_renderer.cpp b/src/svg/output/svg_renderer.cpp index b92347c25..ed4bd09b6 100644 --- a/src/svg/output/svg_renderer.cpp +++ b/src/svg/output/svg_renderer.cpp @@ -20,6 +20,14 @@ * *****************************************************************************/ +// FIXME: workaround incompatibility of karma with -DBOOST_SPIRIT_NO_PREDEFINED_TERMINALS=1 +/* +boost/spirit/repository/home/karma/directive/confix.hpp:49:23: error: no member named + 'confix' in namespace 'boost::spirit::repository' + using repository::confix; +*/ +#undef BOOST_SPIRIT_NO_PREDEFINED_TERMINALS + // mapnik #include #include diff --git a/src/svg/svg_parser.cpp b/src/svg/svg_parser.cpp index 665e17d2d..e9ebc9059 100644 --- a/src/svg/svg_parser.cpp +++ b/src/svg/svg_parser.cpp @@ -80,10 +80,12 @@ struct key_value_sequence_ordered key_value_sequence_ordered() : key_value_sequence_ordered::base_type(query) { - query = pair >> *( qi::lit(';') >> pair); + qi::lit_type lit; + qi::char_type char_; + query = pair >> *( lit(';') >> pair); pair = key >> -(':' >> value); - key = qi::char_("a-zA-Z_") >> *qi::char_("a-zA-Z_0-9-"); - value = +(qi::char_ - qi::lit(';')); + key = char_("a-zA-Z_") >> *char_("a-zA-Z_0-9-"); + value = +(char_ - lit(';')); } qi::rule query; @@ -108,6 +110,7 @@ agg::rgba8 parse_color(const char* str) double parse_double(const char* str) { using namespace boost::spirit::qi; + qi::double_type double_; double val = 0.0; parse(str, str + std::strlen(str),double_,val); return val; @@ -121,7 +124,9 @@ double parse_double_optional_percent(const char* str, bool &percent) { using namespace boost::spirit::qi; using boost::phoenix::ref; - using qi::_1; + qi::_1_type _1; + qi::double_type double_; + qi::char_type char_; double val = 0.0; char unit='\0'; diff --git a/src/text/placements/simple.cpp b/src/text/placements/simple.cpp index f590d9e45..02218b248 100644 --- a/src/text/placements/simple.cpp +++ b/src/text/placements/simple.cpp @@ -39,9 +39,7 @@ namespace mapnik namespace qi = boost::spirit::qi; namespace phoenix = boost::phoenix; using phoenix::push_back; -using boost::spirit::ascii::space; using phoenix::ref; -using qi::_1; bool text_placement_info_simple::next() { @@ -140,10 +138,13 @@ void text_placements_simple::set_positions(std::string positions) } } direction_name; + boost::spirit::ascii::space_type space; + qi::_1_type _1; + qi::float_type float_; std::string::iterator first = positions.begin(), last = positions.end(); qi::phrase_parse(first, last, - (direction_name[push_back(phoenix::ref(direction_), _1)] % ',') >> *(',' >> qi::float_[push_back(phoenix::ref(text_sizes_), _1)]), + (direction_name[push_back(phoenix::ref(direction_), _1)] % ',') >> *(',' >> float_[push_back(phoenix::ref(text_sizes_), _1)]), space ); if (first != last) diff --git a/src/transform_expression_grammar.cpp b/src/transform_expression_grammar.cpp index 4c5ab6d0a..42ad47a5d 100644 --- a/src/transform_expression_grammar.cpp +++ b/src/transform_expression_grammar.cpp @@ -39,14 +39,17 @@ transform_expression_grammar::transform_expression_grammar(expression_ : transform_expression_grammar::base_type(start) { using boost::phoenix::construct; - using qi::_a; using qi::_1; using qi::_4; - using qi::_b; using qi::_2; using qi::_5; - using qi::_c; using qi::_3; using qi::_6; - using qi::_val; - using qi::char_; - using qi::double_; - using qi::lit; - using qi::no_case; + qi::_1_type _1; + qi::_4_type _4; + qi::_2_type _2; + qi::_5_type _5; + qi::_3_type _3; + qi::_6_type _6; + qi::_val_type _val; + qi::char_type char_; + qi::double_type double_; + qi::lit_type lit; + qi::no_case_type no_case; // [http://www.w3.org/TR/SVG/coords.html#TransformAttribute] @@ -56,10 +59,10 @@ transform_expression_grammar::transform_expression_grammar(expression_ // separated by whitespace and/or a comma. #if BOOST_VERSION > 104200 - using qi::no_skip; + qi::no_skip_type no_skip; start = transform_ % no_skip[char_(", ")] ; #else - using qi::lexeme; + qi::lexeme_type lexeme; start = transform_ % lexeme[char_(", ")] ; #endif diff --git a/src/wkt/wkt_factory.cpp b/src/wkt/wkt_factory.cpp index 823965cf4..1b139ee20 100644 --- a/src/wkt/wkt_factory.cpp +++ b/src/wkt/wkt_factory.cpp @@ -44,9 +44,10 @@ wkt_parser::wkt_parser() bool wkt_parser::parse(std::string const& wkt, boost::ptr_vector & paths) { using namespace boost::spirit; + ascii::space_type space; iterator_type first = wkt.begin(); iterator_type last = wkt.end(); - return qi::phrase_parse(first, last, *grammar_, ascii::space, paths); + return qi::phrase_parse(first, last, *grammar_, space, paths); } #endif diff --git a/src/wkt/wkt_generator.cpp b/src/wkt/wkt_generator.cpp index cccb4c8d9..5443c7fc8 100644 --- a/src/wkt/wkt_generator.cpp +++ b/src/wkt/wkt_generator.cpp @@ -58,35 +58,35 @@ template wkt_generator::wkt_generator(bool single) : wkt_generator::base_type(wkt) { - 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; - using boost::spirit::karma::_b; - using boost::spirit::karma::_c; - using boost::spirit::karma::_r1; - using boost::spirit::karma::eps; - using boost::spirit::karma::string; + 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::_b_type _b; + boost::spirit::karma::_c_type _c; + boost::spirit::karma::_r1_type _r1; + boost::spirit::karma::eps_type eps; + boost::spirit::karma::string_type kstring; wkt = point | linestring | polygon ; point = &uint_(mapnik::geometry_type::types::Point)[_1 = _type(_val)] - << string[ phoenix::if_ (single) [_1 = "Point("] + << kstring[ phoenix::if_ (single) [_1 = "Point("] .else_[_1 = "("]] << point_coord [_1 = _first(_val)] << lit(')') ; linestring = &uint_(mapnik::geometry_type::types::LineString)[_1 = _type(_val)] - << string[ phoenix::if_ (single) [_1 = "LineString("] + << kstring[ phoenix::if_ (single) [_1 = "LineString("] .else_[_1 = "("]] << coords << lit(')') ; polygon = &uint_(mapnik::geometry_type::types::Polygon)[_1 = _type(_val)] - << string[ phoenix::if_ (single) [_1 = "Polygon("] + << kstring[ phoenix::if_ (single) [_1 = "Polygon("] .else_[_1 = "("]] << coords2 << lit("))") @@ -97,7 +97,7 @@ wkt_generator::wkt_generator(bool single) polygon_coord %= ( &uint_(mapnik::SEG_MOVETO) << eps[_r1 += 1][_a = _x(_val)][ _b = _y(_val)] - << string[ if_ (_r1 > 1) [_1 = "),("] + << kstring[ if_ (_r1 > 1) [_1 = "),("] .else_[_1 = "("]] | &uint_(mapnik::SEG_LINETO) @@ -119,11 +119,11 @@ template wkt_multi_generator::wkt_multi_generator() : wkt_multi_generator::base_type(wkt) { - 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; + boost::spirit::karma::lit_type lit; + boost::spirit::karma::eps_type eps; + boost::spirit::karma::_val_type _val; + boost::spirit::karma::_1_type _1; + boost::spirit::karma::_a_type _a; geometry_types.add (mapnik::geometry_type::types::Point,"Point")