From c3ec239699b76237f03977fab4ccc052b1e816e8 Mon Sep 17 00:00:00 2001 From: Raul Marin Date: Tue, 3 Apr 2018 13:18:03 +0200 Subject: [PATCH 1/2] Qualify ICU types explicitly ICU 61 has dropped the global `using namespace icu;` http://site.icu-project.org/download/61#TOC-Migration-Issues --- include/mapnik/text/scrptrun.hpp | 2 +- src/text/text_layout.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/mapnik/text/scrptrun.hpp b/include/mapnik/text/scrptrun.hpp index 2161c510d..c219a2a0d 100644 --- a/include/mapnik/text/scrptrun.hpp +++ b/include/mapnik/text/scrptrun.hpp @@ -37,7 +37,7 @@ struct ParenStackEntry UScriptCode scriptCode = USCRIPT_INVALID_CODE; }; -class ScriptRun : public UObject { +class ScriptRun : public icu::UObject { public: ScriptRun(); diff --git a/src/text/text_layout.cpp b/src/text/text_layout.cpp index 3a3818c1f..7b98dab8f 100644 --- a/src/text/text_layout.cpp +++ b/src/text/text_layout.cpp @@ -213,6 +213,7 @@ void text_layout::layout() // At the end everything that is left over is added as the final line. void text_layout::break_line_icu(std::pair && line_limits) { + using BreakIterator = icu::BreakIterator; text_line line(line_limits.first, line_limits.second); shape_text(line); @@ -234,7 +235,7 @@ void text_layout::break_line_icu(std::pair && line_limits) } mapnik::value_unicode_string const& text = itemizer_.text(); - Locale locale; // TODO: Is the default constructor correct? + icu::Locale locale; // TODO: Is the default constructor correct? UErrorCode status = U_ZERO_ERROR; std::unique_ptr breakitr(BreakIterator::createLineInstance(locale, status)); @@ -342,6 +343,7 @@ inline int adjust_last_break_position (int pos, bool repeat_wrap_char) void text_layout::break_line(std::pair && line_limits) { + using BreakIterator = icu::BreakIterator; text_line line(line_limits.first, line_limits.second); shape_text(line); double scaled_wrap_width = wrap_width_ * scale_factor_; From a42ac13cd82e4bf35845021dfeff0315bb4be448 Mon Sep 17 00:00:00 2001 From: Jiri Drbalek Date: Thu, 2 Aug 2018 08:39:34 +0000 Subject: [PATCH 2/2] Force full qualification of ICU types https://github.com/mapnik/mapnik/issues/3961 --- SConstruct | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index 1651824ec..b8eda3c9b 100644 --- a/SConstruct +++ b/SConstruct @@ -42,7 +42,7 @@ ICU_LIBS_DEFAULT='/usr/' DEFAULT_CC = "cc" DEFAULT_CXX = "c++" -DEFAULT_CXX11_CXXFLAGS = " -std=c++11" +DEFAULT_CXX11_CXXFLAGS = " -std=c++11 -DU_USING_ICU_NAMESPACE=0" DEFAULT_CXX11_LINKFLAGS = "" if sys.platform == 'darwin': # homebrew default