Skip to content

Commit

Permalink
fix(mingw): Use correct char16 type for utf_string_conversion_utils (#41
Browse files Browse the repository at this point in the history
)
  • Loading branch information
irov authored Jul 14, 2021
1 parent c5c7867 commit 7a31c84
Showing 1 changed file with 5 additions and 5 deletions.
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

0 comments on commit 7a31c84

Please sign in to comment.