mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 02:17:35 +00:00
LibUnicode: Use weak symbols to provide default IDNA defintions
Rather than using #ifdef blocks, update the fallback IDNA definitions to use weak symbols to match the rest of LibUnicode / LibLocale.
This commit is contained in:
parent
1f0e24bc3b
commit
43e9dc0500
3 changed files with 5 additions and 16 deletions
|
@ -106,13 +106,7 @@ static ErrorOr<void> generate_idna_data_header(Core::InputBufferedFile& file, ID
|
||||||
generator.append(R"~~~(
|
generator.append(R"~~~(
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <AK/Optional.h>
|
|
||||||
#include <LibUnicode/IDNA.h>
|
|
||||||
|
|
||||||
namespace Unicode::IDNA {
|
namespace Unicode::IDNA {
|
||||||
|
|
||||||
Optional<Mapping> get_idna_mapping(u32 code_point);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
)~~~");
|
)~~~");
|
||||||
|
|
||||||
|
@ -128,11 +122,12 @@ static ErrorOr<void> generate_idna_data_implementation(Core::InputBufferedFile&
|
||||||
generator.set("idna_table_size", TRY(String::number(idna_data.mapping_table.size())));
|
generator.set("idna_table_size", TRY(String::number(idna_data.mapping_table.size())));
|
||||||
|
|
||||||
generator.append(R"~~~(
|
generator.append(R"~~~(
|
||||||
|
|
||||||
#include <AK/BinarySearch.h>
|
#include <AK/BinarySearch.h>
|
||||||
|
#include <AK/Optional.h>
|
||||||
#include <AK/Utf32View.h>
|
#include <AK/Utf32View.h>
|
||||||
#include <LibUnicode/IDNAData.h>
|
|
||||||
#include <LibUnicode/CharacterTypes.h>
|
#include <LibUnicode/CharacterTypes.h>
|
||||||
|
#include <LibUnicode/IDNA.h>
|
||||||
|
#include <LibUnicode/IDNAData.h>
|
||||||
|
|
||||||
namespace Unicode::IDNA {
|
namespace Unicode::IDNA {
|
||||||
|
|
||||||
|
|
|
@ -18,14 +18,7 @@
|
||||||
|
|
||||||
namespace Unicode::IDNA {
|
namespace Unicode::IDNA {
|
||||||
|
|
||||||
#if not ENABLE_UNICODE_DATA
|
Optional<Mapping> __attribute__((weak)) get_idna_mapping(u32) { return {}; }
|
||||||
|
|
||||||
Optional<Mapping> get_idna_mapping(u32)
|
|
||||||
{
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
struct ProcessingResult {
|
struct ProcessingResult {
|
||||||
Vector<String> result {};
|
Vector<String> result {};
|
||||||
|
|
|
@ -73,5 +73,6 @@ struct ToAsciiOptions {
|
||||||
};
|
};
|
||||||
|
|
||||||
ErrorOr<String> to_ascii(Utf8View domain_name, ToAsciiOptions const& = {});
|
ErrorOr<String> to_ascii(Utf8View domain_name, ToAsciiOptions const& = {});
|
||||||
|
Optional<Mapping> get_idna_mapping(u32 code_point);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue