Ticket #59441: patch-qt53-qtwebkit-icu59.patch

File patch-qt53-qtwebkit-icu59.patch, 4.5 KB (added by kencu (Ken), 5 years ago)
  • Source/JavaScriptCore/API/JSStringRef.cpp

    From d8d9b1eb468f5e5d5d9f0b196fc0acb641998c8b Mon Sep 17 00:00:00 2001
    From: Konstantin Tokarev <annulen@yandex.ru>
    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
    
    Task-number: QTBUG-60532
    Change-Id: I6014feea213aa70ebe40b09d9d1a03fd1ed3c843
    Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
    ---
     Source/JavaScriptCore/API/JSStringRef.cpp        | 6 +++---
     Source/JavaScriptCore/runtime/DateConversion.cpp | 3 ++-
     Source/WTF/wtf/TypeTraits.h                      | 3 +++
     Source/WebKit2/Shared/API/c/WKString.cpp         | 2 +-
     4 files changed, 9 insertions(+), 5 deletions(-)
    
    diff --git Source/JavaScriptCore/API/JSStringRef.cpp Source/JavaScriptCore/API/JSStringRef.cpp
    index 812f3d413..77a3fd0f4 100644
    using namespace WTF::Unicode; 
    3737JSStringRef JSStringCreateWithCharacters(const JSChar* chars, size_t numChars)
    3838{
    3939    initializeThreading();
    40     return OpaqueJSString::create(chars, numChars).leakRef();
     40    return OpaqueJSString::create(reinterpret_cast<const UChar*>(chars), numChars).leakRef();
    4141}
    4242
    4343JSStringRef JSStringCreateWithUTF8CString(const char* string)
    JSStringRef JSStringCreateWithUTF8CString(const char* string) 
    6262JSStringRef JSStringCreateWithCharactersNoCopy(const JSChar* chars, size_t numChars)
    6363{
    6464    initializeThreading();
    65     return OpaqueJSString::create(StringImpl::createWithoutCopying(chars, numChars, WTF::DoesNotHaveTerminatingNullCharacter)).leakRef();
     65    return OpaqueJSString::create(StringImpl::createWithoutCopying(reinterpret_cast<const UChar*>(chars), numChars, WTF::DoesNotHaveTerminatingNullCharacter)).leakRef();
    6666}
    6767
    6868JSStringRef JSStringRetain(JSStringRef string)
    size_t JSStringGetLength(JSStringRef string) 
    8383
    8484const JSChar* JSStringGetCharactersPtr(JSStringRef string)
    8585{
    86     return string->characters();
     86    return reinterpret_cast<const JSChar*>(string->characters());
    8787}
    8888
    8989size_t JSStringGetMaximumUTF8CStringSize(JSStringRef string)
  • Source/JavaScriptCore/runtime/DateConversion.cpp

    diff --git Source/JavaScriptCore/runtime/DateConversion.cpp Source/JavaScriptCore/runtime/DateConversion.cpp
    index 0b57f012d..05e27338b 100644
    String formatDateTime(const GregorianDateTime& t, DateTimeFormat format, bool as 
    107107#if OS(WINDOWS)
    108108            TIME_ZONE_INFORMATION timeZoneInformation;
    109109            GetTimeZoneInformation(&timeZoneInformation);
    110             const WCHAR* timeZoneName = t.isDST() ? timeZoneInformation.DaylightName : timeZoneInformation.StandardName;
     110            const WCHAR* winTimeZoneName = t.isDST() ? timeZoneInformation.DaylightName : timeZoneInformation.StandardName;
     111            String timeZoneName(reinterpret_cast<const UChar*>(winTimeZoneName));
    111112#else
    112113            struct tm gtm = t;
    113114            char timeZoneName[70];
  • Source/WTF/wtf/TypeTraits.h

    diff --git Source/WTF/wtf/TypeTraits.h Source/WTF/wtf/TypeTraits.h
    index 9df2c95cf..f5d6121fd 100644
    namespace WTF { 
    7272    template<> struct IsInteger<unsigned long>      { static const bool value = true; };
    7373    template<> struct IsInteger<long long>          { static const bool value = true; };
    7474    template<> struct IsInteger<unsigned long long> { static const bool value = true; };
     75#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__) || (defined(_HAS_CHAR16_T_LANGUAGE_SUPPORT) && _HAS_CHAR16_T_LANGUAGE_SUPPORT)
     76    template<> struct IsInteger<char16_t>           { static const bool value = true; };
     77#endif
    7578#if !COMPILER(MSVC) || defined(_NATIVE_WCHAR_T_DEFINED)
    7679    template<> struct IsInteger<wchar_t>            { static const bool value = true; };
    7780#endif
  • Source/WebKit2/Shared/API/c/WKString.cpp

    diff --git Source/WebKit2/Shared/API/c/WKString.cpp Source/WebKit2/Shared/API/c/WKString.cpp
    index cbac67dd8..23400a64e 100644
    size_t WKStringGetLength(WKStringRef stringRef) 
    5555size_t WKStringGetCharacters(WKStringRef stringRef, WKChar* buffer, size_t bufferLength)
    5656{
    5757    COMPILE_ASSERT(sizeof(WKChar) == sizeof(UChar), WKStringGetCharacters_sizeof_WKChar_matches_UChar);
    58     return (toImpl(stringRef)->getCharacters(static_cast<UChar*>(buffer), bufferLength));
     58    return (toImpl(stringRef)->getCharacters(reinterpret_cast<UChar*>(buffer), bufferLength));
    5959}
    6060
    6161size_t WKStringGetMaximumUTF8CStringSize(WKStringRef stringRef)