14#define SK_RUNTIME_ICU_PATHS "libicuuc.so"
19 void* dlhnd =
nullptr;
20 for (
const auto path : gLibPaths) {
21 dlhnd = dlopen(
path, RTLD_LAZY);
28 SkDEBUGF(
"ICU loader: failed to open libicuuc.\n");
34 bool resolved_required_syms =
true;
36 auto resolve_sym = [&](
void* hnd,
const char name[],
bool required =
false) ->
void* {
37 static constexpr int kMinVer = 44,
42 const auto search_to = icu_ver > 0 ? icu_ver : kMaxVer;
43 icu_ver = icu_ver > 0 ? icu_ver : kMinVer;
47 if (
auto*
addr = dlsym(dlhnd,
sym.c_str())) {
51 if (icu_ver == search_to) {
59 resolved_required_syms =
false;
71 #define SKICU_FUNC(fname) *(void**)(&lib.f_##fname) = resolve_sym(dlhnd, #fname, true);
74 *(
void**)(&lib.f_ubrk_clone_) = resolve_sym(dlhnd,
"ubrk_clone");
75 *(
void**)(&lib.f_ubrk_safeClone_) = resolve_sym(dlhnd,
"ubrk_safeClone");
76 *(
void**)(&lib.f_ubrk_getLocaleByType) = resolve_sym(dlhnd,
"ubrk_getLocaleByType");
78 if (!resolved_required_syms || (!lib.f_ubrk_clone_ && !lib.f_ubrk_safeClone_)) {
79 SkDEBUGF(
"ICU loader: failed to resolve required symbols.");
84 return std::make_unique<SkICULib>(lib);
SK_API SkString SkStringPrintf(const char *format,...) SK_PRINTF_LIKE(1
Creates a new string and writes into it using a printf()-style format.
#define SK_RUNTIME_ICU_PATHS
std::unique_ptr< SkICULib > SkLoadICULib()
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
DEF_SWITCHES_START aot vmservice shared library name