46 lines
1.5 KiB
Diff
46 lines
1.5 KiB
Diff
From 4c8f4faae92393d5949115d9767b1b5eec041762 Mon Sep 17 00:00:00 2001
|
|
From: artemp <artem@mapnik.org>
|
|
Date: Wed, 19 Jul 2017 16:07:39 +0200
|
|
Subject: [PATCH] Add support for U_ICU_VERSION_MAJOR_NUM >= 59 (#3729)
|
|
|
|
---
|
|
include/mapnik/text/harfbuzz_shaper.hpp | 4 +++-
|
|
include/mapnik/unicode.hpp | 2 ++
|
|
2 files changed, 5 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/include/mapnik/text/harfbuzz_shaper.hpp b/include/mapnik/text/harfbuzz_shaper.hpp
|
|
index 8b574b095f..14151cf7d8 100644
|
|
--- a/include/mapnik/text/harfbuzz_shaper.hpp
|
|
+++ b/include/mapnik/text/harfbuzz_shaper.hpp
|
|
@@ -40,6 +40,7 @@
|
|
#include <mapnik/warning_ignore.hpp>
|
|
#include <harfbuzz/hb.h>
|
|
#include <harfbuzz/hb-ft.h>
|
|
+#include <unicode/uvernum.h>
|
|
#include <unicode/uscript.h>
|
|
#pragma GCC diagnostic pop
|
|
|
|
@@ -55,7 +56,8 @@ static inline hb_script_t _icu_script_to_script(UScriptCode script)
|
|
static inline const uint16_t * uchar_to_utf16(const UChar* src)
|
|
{
|
|
static_assert(sizeof(UChar) == sizeof(uint16_t),"UChar is eq size to uint16_t");
|
|
-#if defined(_MSC_VER)
|
|
+#if defined(_MSC_VER) || (U_ICU_VERSION_MAJOR_NUM >= 59)
|
|
+ // ^^ http://site.icu-project.org/download/59#TOC-ICU4C-char16_t1
|
|
return reinterpret_cast<const uint16_t *>(src);
|
|
#else
|
|
return src;
|
|
diff --git a/include/mapnik/unicode.hpp b/include/mapnik/unicode.hpp
|
|
index f3b270cb93..83ed3b126e 100644
|
|
--- a/include/mapnik/unicode.hpp
|
|
+++ b/include/mapnik/unicode.hpp
|
|
@@ -31,6 +31,8 @@
|
|
// std
|
|
#include <cstdint>
|
|
#include <string>
|
|
+// icu
|
|
+#include <unicode/unistr.h>
|
|
|
|
struct UConverter;
|
|
|