diff --git a/include/internal/cef_string.h b/include/internal/cef_string.h index 192164915..75db22b5e 100644 --- a/include/internal/cef_string.h +++ b/include/internal/cef_string.h @@ -74,7 +74,7 @@ typedef cef_string_userfree_utf8_t cef_string_userfree_t; #define cef_string_to_wide cef_string_utf8_to_wide #define cef_string_from_wide cef_string_wide_to_utf8 #elif defined(CEF_STRING_TYPE_UTF16) -typedef char16_t cef_char_t; +typedef char16 cef_char_t; typedef cef_string_userfree_utf16_t cef_string_userfree_t; typedef cef_string_utf16_t cef_string_t; #define cef_string_set cef_string_utf16_set diff --git a/include/internal/cef_string_types.h b/include/internal/cef_string_types.h index 28d182169..f71ffed6c 100644 --- a/include/internal/cef_string_types.h +++ b/include/internal/cef_string_types.h @@ -43,13 +43,13 @@ extern "C" { #include "cef_export.h" #include -// CEF character type definitions. wchat_t is 2 bytes on Windows and 4 bytes on +// CEF character type definitions. wchar_t is 2 bytes on Windows and 4 bytes on // most other platforms. #if defined(OS_WIN) -typedef wchar_t char16_t; +typedef wchar_t char16; #else // !OS_WIN -typedef unsigned short char16_t; +typedef unsigned short char16; #ifndef WCHAR_T_IS_UTF32 #define WCHAR_T_IS_UTF32 #endif // WCHAR_T_IS_UTF32 @@ -76,9 +76,9 @@ typedef struct _cef_string_utf8_t { } cef_string_utf8_t; typedef struct _cef_string_utf16_t { - char16_t* str; + char16* str; size_t length; - void (*dtor)(char16_t* str); + void (*dtor)(char16* str); } cef_string_utf16_t; @@ -92,7 +92,7 @@ CEF_EXPORT int cef_string_wide_set(const wchar_t* src, size_t src_len, cef_string_wide_t* output, int copy); CEF_EXPORT int cef_string_utf8_set(const char* src, size_t src_len, cef_string_utf8_t* output, int copy); -CEF_EXPORT int cef_string_utf16_set(const char16_t* src, size_t src_len, +CEF_EXPORT int cef_string_utf16_set(const char16* src, size_t src_len, cef_string_utf16_t* output, int copy); @@ -143,12 +143,12 @@ CEF_EXPORT int cef_string_utf8_to_wide(const char* src, size_t src_len, CEF_EXPORT int cef_string_wide_to_utf16(const wchar_t* src, size_t src_len, cef_string_utf16_t* output); -CEF_EXPORT int cef_string_utf16_to_wide(const char16_t* src, size_t src_len, +CEF_EXPORT int cef_string_utf16_to_wide(const char16* src, size_t src_len, cef_string_wide_t* output); CEF_EXPORT int cef_string_utf8_to_utf16(const char* src, size_t src_len, cef_string_utf16_t* output); -CEF_EXPORT int cef_string_utf16_to_utf8(const char16_t* src, size_t src_len, +CEF_EXPORT int cef_string_utf16_to_utf8(const char16* src, size_t src_len, cef_string_utf8_t* output); diff --git a/include/internal/cef_string_wrappers.h b/include/internal/cef_string_wrappers.h index a5645d1f7..06fc42697 100644 --- a/include/internal/cef_string_wrappers.h +++ b/include/internal/cef_string_wrappers.h @@ -188,7 +188,7 @@ struct CefStringTraitsUTF8 { // Traits implementation for utf16 character strings. /// struct CefStringTraitsUTF16 { - typedef char16_t char_type; + typedef char16 char_type; typedef cef_string_utf16_t struct_type; typedef cef_string_userfree_utf16_t userfree_struct_type; @@ -339,7 +339,7 @@ public: /// CefStringBase(const string16& src) : string_(NULL), owner_(false) { FromString16(src); } - CefStringBase(const char16_t* src) : string_(NULL), owner_(false) + CefStringBase(const char16* src) : string_(NULL), owner_(false) { FromString16(string16(src)); } #endif // BUILDING_CEF_SHARED && WCHAR_T_IS_UTF32 @@ -667,7 +667,7 @@ public: operator string16() const { return ToString16(); } CefStringBase& operator=(const string16& str) { FromString16(str); return *this; } - CefStringBase& operator=(const char16_t* str) + CefStringBase& operator=(const char16* str) { FromString16(string16(str)); return *this; } #endif // BUILDING_CEF_SHARED && WCHAR_T_IS_UTF32 diff --git a/libcef/cef_string_types.cc b/libcef/cef_string_types.cc index 6a9456695..2a9942c8c 100644 --- a/libcef/cef_string_types.cc +++ b/libcef/cef_string_types.cc @@ -19,7 +19,7 @@ void string_utf8_dtor(char* str) delete [] str; } -void string_utf16_dtor(char16_t* str) +void string_utf16_dtor(char16* str) { delete [] str; } @@ -74,24 +74,24 @@ CEF_EXPORT int cef_string_utf8_set(const char* src, size_t src_len, return 1; } -CEF_EXPORT int cef_string_utf16_set(const char16_t* src, size_t src_len, +CEF_EXPORT int cef_string_utf16_set(const char16* src, size_t src_len, cef_string_utf16_t* output, int copy) { cef_string_utf16_clear(output); if (copy) { if (src && src_len > 0) { - output->str = new char16_t[src_len+1]; + output->str = new char16[src_len+1]; if (!output->str) return 0; - memcpy(output->str, src, src_len * sizeof(char16_t)); + memcpy(output->str, src, src_len * sizeof(char16)); output->str[src_len] = 0; output->length = src_len; output->dtor = string_utf16_dtor; } } else { - output->str = const_cast(src); + output->str = const_cast(src); output->length = src_len; output->dtor = NULL; } @@ -211,7 +211,7 @@ CEF_EXPORT int cef_string_wide_to_utf16(const wchar_t* src, size_t src_len, return ret; } -CEF_EXPORT int cef_string_utf16_to_wide(const char16_t* src, size_t src_len, +CEF_EXPORT int cef_string_utf16_to_wide(const char16* src, size_t src_len, cef_string_wide_t* output) { std::wstring str; @@ -231,7 +231,7 @@ CEF_EXPORT int cef_string_utf8_to_utf16(const char* src, size_t src_len, return ret; } -CEF_EXPORT int cef_string_utf16_to_utf8(const char16_t* src, size_t src_len, +CEF_EXPORT int cef_string_utf16_to_utf8(const char16* src, size_t src_len, cef_string_utf8_t* output) { std::string str;