qtwebkit-5.6.2-icu-59.patch 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. From bf172ae289a1348842005a9421797970f9b72060 Mon Sep 17 00:00:00 2001
  2. From: Konstantin Tokarev <annulen@yandex.ru>
  3. Date: Thu, 4 May 2017 15:12:37 +0300
  4. Subject: [PATCH] Fix compilation with ICU 59
  5. Upstream fix: https://bugs.webkit.org/show_bug.cgi?id=171612
  6. Task-number: QTBUG-60532
  7. Change-Id: I6014feea213aa70ebe40b09d9d1a03fd1ed3c843
  8. Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
  9. ---
  10. Source/JavaScriptCore/API/JSStringRef.cpp | 6 +++---
  11. Source/JavaScriptCore/runtime/DateConversion.cpp | 3 ++-
  12. Source/WTF/wtf/TypeTraits.h | 3 +++
  13. Source/WebKit2/Shared/API/c/WKString.cpp | 2 +-
  14. 4 files changed, 9 insertions(+), 5 deletions(-)
  15. diff --git a/Source/JavaScriptCore/API/JSStringRef.cpp b/Source/JavaScriptCore/API/JSStringRef.cpp
  16. index 812f3d413..77a3fd0f4 100644
  17. --- a/Source/JavaScriptCore/API/JSStringRef.cpp
  18. +++ b/Source/JavaScriptCore/API/JSStringRef.cpp
  19. @@ -37,7 +37,7 @@ using namespace WTF::Unicode;
  20. JSStringRef JSStringCreateWithCharacters(const JSChar* chars, size_t numChars)
  21. {
  22. initializeThreading();
  23. - return OpaqueJSString::create(chars, numChars).leakRef();
  24. + return OpaqueJSString::create(reinterpret_cast<const UChar*>(chars), numChars).leakRef();
  25. }
  26. JSStringRef JSStringCreateWithUTF8CString(const char* string)
  27. @@ -62,7 +62,7 @@ JSStringRef JSStringCreateWithUTF8CString(const char* string)
  28. JSStringRef JSStringCreateWithCharactersNoCopy(const JSChar* chars, size_t numChars)
  29. {
  30. initializeThreading();
  31. - return OpaqueJSString::create(StringImpl::createWithoutCopying(chars, numChars, WTF::DoesNotHaveTerminatingNullCharacter)).leakRef();
  32. + return OpaqueJSString::create(StringImpl::createWithoutCopying(reinterpret_cast<const UChar*>(chars), numChars, WTF::DoesNotHaveTerminatingNullCharacter)).leakRef();
  33. }
  34. JSStringRef JSStringRetain(JSStringRef string)
  35. @@ -83,7 +83,7 @@ size_t JSStringGetLength(JSStringRef string)
  36. const JSChar* JSStringGetCharactersPtr(JSStringRef string)
  37. {
  38. - return string->characters();
  39. + return reinterpret_cast<const JSChar*>(string->characters());
  40. }
  41. size_t JSStringGetMaximumUTF8CStringSize(JSStringRef string)
  42. diff --git a/Source/JavaScriptCore/runtime/DateConversion.cpp b/Source/JavaScriptCore/runtime/DateConversion.cpp
  43. index 0b57f012d..05e27338b 100644
  44. --- a/Source/JavaScriptCore/runtime/DateConversion.cpp
  45. +++ b/Source/JavaScriptCore/runtime/DateConversion.cpp
  46. @@ -107,7 +107,8 @@ String formatDateTime(const GregorianDateTime& t, DateTimeFormat format, bool as
  47. #if OS(WINDOWS)
  48. TIME_ZONE_INFORMATION timeZoneInformation;
  49. GetTimeZoneInformation(&timeZoneInformation);
  50. - const WCHAR* timeZoneName = t.isDST() ? timeZoneInformation.DaylightName : timeZoneInformation.StandardName;
  51. + const WCHAR* winTimeZoneName = t.isDST() ? timeZoneInformation.DaylightName : timeZoneInformation.StandardName;
  52. + String timeZoneName(reinterpret_cast<const UChar*>(winTimeZoneName));
  53. #else
  54. struct tm gtm = t;
  55. char timeZoneName[70];
  56. diff --git a/Source/WTF/wtf/TypeTraits.h b/Source/WTF/wtf/TypeTraits.h
  57. index 9df2c95cf..f5d6121fd 100644
  58. --- a/Source/WTF/wtf/TypeTraits.h
  59. +++ b/Source/WTF/wtf/TypeTraits.h
  60. @@ -72,6 +72,9 @@ namespace WTF {
  61. template<> struct IsInteger<unsigned long> { static const bool value = true; };
  62. template<> struct IsInteger<long long> { static const bool value = true; };
  63. template<> struct IsInteger<unsigned long long> { static const bool value = true; };
  64. +#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__) || (defined(_HAS_CHAR16_T_LANGUAGE_SUPPORT) && _HAS_CHAR16_T_LANGUAGE_SUPPORT)
  65. + template<> struct IsInteger<char16_t> { static const bool value = true; };
  66. +#endif
  67. #if !COMPILER(MSVC) || defined(_NATIVE_WCHAR_T_DEFINED)
  68. template<> struct IsInteger<wchar_t> { static const bool value = true; };
  69. #endif
  70. diff --git a/Source/WebKit2/Shared/API/c/WKString.cpp b/Source/WebKit2/Shared/API/c/WKString.cpp
  71. index cbac67dd8..23400a64e 100644
  72. --- a/Source/WebKit2/Shared/API/c/WKString.cpp
  73. +++ b/Source/WebKit2/Shared/API/c/WKString.cpp
  74. @@ -55,7 +55,7 @@ size_t WKStringGetLength(WKStringRef stringRef)
  75. size_t WKStringGetCharacters(WKStringRef stringRef, WKChar* buffer, size_t bufferLength)
  76. {
  77. COMPILE_ASSERT(sizeof(WKChar) == sizeof(UChar), WKStringGetCharacters_sizeof_WKChar_matches_UChar);
  78. - return (toImpl(stringRef)->getCharacters(static_cast<UChar*>(buffer), bufferLength));
  79. + return (toImpl(stringRef)->getCharacters(reinterpret_cast<UChar*>(buffer), bufferLength));
  80. }
  81. size_t WKStringGetMaximumUTF8CStringSize(WKStringRef stringRef)
  82. --
  83. 2.13.1