Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mingw] fix char16 type for utf_string_conversion_utils #41

Merged
merged 1 commit into from
Jul 14, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions third_party/mini_chromium/utf_string_conversion_utils.mingw.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ bool ReadUnicodeCharacter(const char* src,
return IsValidCodepoint(code_point);
}

bool ReadUnicodeCharacter(const char16* src,
bool ReadUnicodeCharacter(const char16_t* src,
int32_t src_len,
int32_t* char_index,
uint32_t* code_point) {
Expand Down Expand Up @@ -58,9 +58,9 @@ size_t WriteUnicodeCharacter(uint32_t code_point, std::string* output) {
return char_offset - original_char_offset;
}

size_t WriteUnicodeCharacter(uint32_t code_point, string16* output) {
size_t WriteUnicodeCharacter(uint32_t code_point, std::u16string* output) {
if (CBU16_LENGTH(code_point) == 1) {
output->push_back(static_cast<char16>(code_point));
output->push_back(static_cast<char16_t>(code_point));
return 1;
}
size_t char_offset = output->length();
Expand All @@ -84,7 +84,7 @@ void PrepareForUTF8Output(const CHAR* src,
}

template void PrepareForUTF8Output(const wchar_t*, size_t, std::string*);
// template void PrepareForUTF8Output(const char16*, size_t, std::string*);
template void PrepareForUTF8Output(const char16_t*, size_t, std::string*);

template<typename STRING>
void PrepareForUTF16Or32Output(const char* src,
Expand All @@ -100,6 +100,6 @@ void PrepareForUTF16Or32Output(const char* src,
}
}

template void PrepareForUTF16Or32Output(const char*, size_t, string16*);
template void PrepareForUTF16Or32Output(const char*, size_t, std::u16string*);

} // namespace base