quick fix to allow compiling without unicode regex support to enable builds against ICU <4.2
This commit is contained in:
parent
8ac189ccf2
commit
05654f18bc
1 changed files with 9 additions and 0 deletions
|
@ -24,6 +24,9 @@
|
||||||
|
|
||||||
#include <mapnik/expression_string.hpp>
|
#include <mapnik/expression_string.hpp>
|
||||||
#include <boost/variant.hpp>
|
#include <boost/variant.hpp>
|
||||||
|
#include <unicode/uvernum.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
namespace mapnik
|
namespace mapnik
|
||||||
{
|
{
|
||||||
|
@ -73,6 +76,8 @@ struct expression_string : boost::static_visitor<void>
|
||||||
|
|
||||||
void operator() (regex_match_node const & x) const
|
void operator() (regex_match_node const & x) const
|
||||||
{
|
{
|
||||||
|
// TODO - replace with pre ICU 4.2 compatible fromUTF32()
|
||||||
|
#if (U_ICU_VERSION_MAJOR_NUM >= 4) && (U_ICU_VERSION_MINOR_NUM >=2)
|
||||||
boost::apply_visitor(expression_string(str_),x.expr);
|
boost::apply_visitor(expression_string(str_),x.expr);
|
||||||
str_ +=".match(";
|
str_ +=".match(";
|
||||||
std::string utf8;
|
std::string utf8;
|
||||||
|
@ -80,10 +85,13 @@ struct expression_string : boost::static_visitor<void>
|
||||||
to_utf8(ustr,utf8);
|
to_utf8(ustr,utf8);
|
||||||
str_ += utf8;
|
str_ += utf8;
|
||||||
str_ +=")";
|
str_ +=")";
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void operator() (regex_replace_node const & x) const
|
void operator() (regex_replace_node const & x) const
|
||||||
{
|
{
|
||||||
|
// TODO - replace with pre ICU 4.2 compatible fromUTF32()
|
||||||
|
#if (U_ICU_VERSION_MAJOR_NUM >= 4) && (U_ICU_VERSION_MINOR_NUM >=2)
|
||||||
boost::apply_visitor(expression_string(str_),x.expr);
|
boost::apply_visitor(expression_string(str_),x.expr);
|
||||||
str_ +=".replace(";
|
str_ +=".replace(";
|
||||||
std::string utf8;
|
std::string utf8;
|
||||||
|
@ -95,6 +103,7 @@ struct expression_string : boost::static_visitor<void>
|
||||||
to_utf8(x.format ,utf8);
|
to_utf8(x.format ,utf8);
|
||||||
str_ += utf8;
|
str_ += utf8;
|
||||||
str_ +="')";
|
str_ +="')";
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Loading…
Reference in a new issue