mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-13 14:42:51 +00:00
LibUnicode: Add temporary overload of value-from-string generator
This is a temporary mechanism while LibUnicode is in an in-between state where some symbols are weakly linked and others are dynamically loaded. The latter require an asm() label to be loaded.
This commit is contained in:
parent
ba4cdf34f8
commit
cf8e11a562
Notes:
sideshowbarker
2024-07-17 21:39:10 +09:00
Author: https://github.com/trflynn89
Commit: cf8e11a562
Pull-request: https://github.com/SerenityOS/serenity/pull/11622
3 changed files with 55 additions and 3 deletions
|
@ -1068,7 +1068,7 @@ Optional<StringView> get_locale_@enum_snake@_mapping(StringView locale, StringVi
|
|||
for (auto const& alias : aliases)
|
||||
hashes.set(alias.alias.hash(), format_identifier(enum_title, alias.alias));
|
||||
|
||||
generate_value_from_string(generator, "{}_from_string"sv, enum_title, enum_snake, move(hashes));
|
||||
generate_value_from_string_for_dynamic_loading(generator, "{}_from_string"sv, enum_title, enum_snake, move(hashes));
|
||||
};
|
||||
|
||||
auto append_alias_search = [&](StringView enum_snake, auto const& aliases) {
|
||||
|
@ -1078,7 +1078,7 @@ Optional<StringView> get_locale_@enum_snake@_mapping(StringView locale, StringVi
|
|||
for (auto const& alias : aliases)
|
||||
hashes.set(alias.key.hash(), alias.value);
|
||||
|
||||
generate_value_from_string(generator, "resolve_{}_alias"sv, s_string_index_type, enum_snake, move(hashes), "StringView"sv, "s_string_list[{}]"sv);
|
||||
generate_value_from_string_for_dynamic_loading(generator, "resolve_{}_alias"sv, s_string_index_type, enum_snake, move(hashes), "StringView"sv, "s_string_list[{}]"sv);
|
||||
};
|
||||
|
||||
append_from_string("Locale"sv, "locale"sv, locale_data.locales.keys(), locale_data.locale_aliases);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue