/* * Copyright 2021 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include "modules/skunicode/src/SkUnicode_icu.h" #include #include #include #include #define SKICU_FUNC(funcname) funcname, // ubrk_clone added as draft in ICU69 and Android API 31 (first ICU NDK). // ubrk_safeClone deprecated in ICU69 and not exposed by Android. template using void_t = void; template struct SkUbrkClone { static UBreakIterator* clone(T bi, UErrorCode* status) { return ubrk_safeClone(bi, nullptr, nullptr, status); } }; template struct SkUbrkClone(), nullptr))>> { static UBreakIterator* clone(T bi, UErrorCode* status) { return ubrk_clone(bi, status); } }; std::unique_ptr SkLoadICULib() { return std::make_unique(SkICULib{ SKICU_EMIT_FUNCS &SkUbrkClone::clone, nullptr, }); }