From d8d9b1eb468f5e5d5d9f0b196fc0acb641998c8b Mon Sep 17 00:00:00 2001 From: Konstantin Tokarev Date: Thu, 4 May 2017 15:12:37 +0300 Subject: [PATCH] Fix compilation with ICU 59 Upstream fix: https://bugs.webkit.org/show_bug.cgi?id=171612 diff --git a/Source/JavaScriptCore/API/JSStringRef.cpp b/Source/JavaScriptCore/API/JSStringRef.cpp index 812f3d413..77a3fd0f4 100644 --- a/Source/JavaScriptCore/API/JSStringRef.cpp +++ b/Source/JavaScriptCore/API/JSStringRef.cpp @@ -37,7 +37,7 @@ using namespace WTF::Unicode; JSStringRef JSStringCreateWithCharacters(const JSChar* chars, size_t numChars) { initializeThreading(); - return OpaqueJSString::create(chars, numChars).leakRef(); + return OpaqueJSString::create(reinterpret_cast(chars), numChars).leakRef(); } JSStringRef JSStringCreateWithUTF8CString(const char* string) @@ -62,7 +62,7 @@ JSStringRef JSStringCreateWithUTF8CString(const char* string) JSStringRef JSStringCreateWithCharactersNoCopy(const JSChar* chars, size_t numChars) { initializeThreading(); - return OpaqueJSString::create(StringImpl::createWithoutCopying(chars, numChars)).leakRef(); + return OpaqueJSString::create(StringImpl::createWithoutCopying(reinterpret_cast(chars), numChars)).leakRef(); } JSStringRef JSStringRetain(JSStringRef string) @@ -83,7 +83,7 @@ size_t JSStringGetLength(JSStringRef string) const JSChar* JSStringGetCharactersPtr(JSStringRef string) { - return string->characters(); + return reinterpret_cast(string->characters()); } size_t JSStringGetMaximumUTF8CStringSize(JSStringRef string) diff --git a/Source/JavaScriptCore/runtime/DateConversion.cpp b/Source/JavaScriptCore/runtime/DateConversion.cpp index 0b57f012d..05e27338b 100644 --- a/Source/JavaScriptCore/runtime/DateConversion.cpp +++ b/Source/JavaScriptCore/runtime/DateConversion.cpp @@ -107,7 +107,8 @@ String formatDateTime(const GregorianDateTime& t, DateTimeFormat format, bool as #if OS(WINDOWS) TIME_ZONE_INFORMATION timeZoneInformation; GetTimeZoneInformation(&timeZoneInformation); - const WCHAR* timeZoneName = t.isDST() ? timeZoneInformation.DaylightName : timeZoneInformation.StandardName; + const WCHAR* winTimeZoneName = t.isDST() ? timeZoneInformation.DaylightName : timeZoneInformation.StandardName; + String timeZoneName(reinterpret_cast(winTimeZoneName)); #else struct tm gtm = t; char timeZoneName[70]; diff --git a/Source/WTF/wtf/TypeTraits.h b/Source/WTF/wtf/TypeTraits.h index 9df2c95cf..f5d6121fd 100644 --- a/Source/WTF/wtf/TypeTraits.h +++ b/Source/WTF/wtf/TypeTraits.h @@ -72,6 +72,9 @@ namespace WTF { template<> struct IsInteger { static const bool value = true; }; template<> struct IsInteger { static const bool value = true; }; template<> struct IsInteger { static const bool value = true; }; +#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__) || (defined(_HAS_CHAR16_T_LANGUAGE_SUPPORT) && _HAS_CHAR16_T_LANGUAGE_SUPPORT) + template<> struct IsInteger { static const bool value = true; }; +#endif #if !COMPILER(MSVC) || defined(_NATIVE_WCHAR_T_DEFINED) template<> struct IsInteger { static const bool value = true; }; #endif diff --git a/Source/WebKit2/Shared/API/c/WKString.cpp b/Source/WebKit2/Shared/API/c/WKString.cpp index cbac67dd8..23400a64e 100644 --- a/Source/WebKit2/Shared/API/c/WKString.cpp +++ b/Source/WebKit2/Shared/API/c/WKString.cpp @@ -55,7 +55,7 @@ size_t WKStringGetLength(WKStringRef stringRef) size_t WKStringGetCharacters(WKStringRef stringRef, WKChar* buffer, size_t bufferLength) { COMPILE_ASSERT(sizeof(WKChar) == sizeof(UChar), WKStringGetCharacters_sizeof_WKChar_matches_UChar); - return (toImpl(stringRef)->getCharacters(static_cast(buffer), bufferLength)); + return (toImpl(stringRef)->getCharacters(reinterpret_cast(buffer), bufferLength)); } size_t WKStringGetMaximumUTF8CStringSize(WKStringRef stringRef) -- 2.13.3