Changeset 216187 in webkit


Ignore:
Timestamp:
May 4, 2017 8:33:41 AM (7 years ago)
Author:
Konstantin Tokarev
Message:

Fix compilation with ICU 59.1
https://bugs.webkit.org/show_bug.cgi?id=171612

Reviewed by Mark Lam.

ICU 59.1 has broken source compatibility. Now it defines UChar as
char16_t, which does not allow automatic type conversion from unsigned
short in C++ code.

Source/JavaScriptCore:

  • API/JSStringRef.cpp:

(JSStringCreateWithCharacters):
(JSStringCreateWithCharactersNoCopy):
(JSStringGetCharactersPtr):

  • runtime/DateConversion.cpp:

(JSC::formatDateTime):

Source/WebKit2:

  • Shared/API/c/WKString.cpp:

(WKStringGetCharacters):

Tools:

  • TestRunnerShared/UIScriptContext/UIScriptContext.cpp:

(UIScriptContext::tryToCompleteUIScriptForCurrentParentCallback):

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSStringRef.cpp

    r185346 r216187  
    3838{
    3939    initializeThreading();
    40     return &OpaqueJSString::create(chars, numChars).leakRef();
     40    return &OpaqueJSString::create(reinterpret_cast<const UChar*>(chars), numChars).leakRef();
    4141}
    4242
     
    6363{
    6464    initializeThreading();
    65     return OpaqueJSString::create(StringImpl::createWithoutCopying(chars, numChars)).leakRef();
     65    return OpaqueJSString::create(StringImpl::createWithoutCopying(reinterpret_cast<const UChar*>(chars), numChars)).leakRef();
    6666}
    6767
     
    8888    if (!string)
    8989        return nullptr;
    90     return string->characters();
     90    return reinterpret_cast<const JSChar*>(string->characters());
    9191}
    9292
  • trunk/Source/JavaScriptCore/ChangeLog

    r216180 r216187  
     12017-05-04  Konstantin Tokarev  <annulen@yandex.ru>
     2
     3        Fix compilation with ICU 59.1
     4        https://bugs.webkit.org/show_bug.cgi?id=171612
     5
     6        Reviewed by Mark Lam.
     7
     8        ICU 59.1 has broken source compatibility. Now it defines UChar as
     9        char16_t, which does not allow automatic type conversion from unsigned
     10        short in C++ code.
     11
     12        * API/JSStringRef.cpp:
     13        (JSStringCreateWithCharacters):
     14        (JSStringCreateWithCharactersNoCopy):
     15        (JSStringGetCharactersPtr):
     16        * runtime/DateConversion.cpp:
     17        (JSC::formatDateTime):
     18
    1192017-05-04  Saam Barati  <sbarati@apple.com>
    220
  • trunk/Source/JavaScriptCore/runtime/DateConversion.cpp

    r205787 r216187  
    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;
     
    116117            if (timeZoneName[0]) {
    117118                builder.appendLiteral(" (");
    118 #if OS(WINDOWS)
    119                 builder.append(String(timeZoneName));
    120 #else
    121119                builder.append(timeZoneName);
    122 #endif
    123120                builder.append(')');
    124121            }
  • trunk/Source/WebKit2/ChangeLog

    r216186 r216187  
     12017-05-04  Konstantin Tokarev  <annulen@yandex.ru>
     2
     3        Fix compilation with ICU 59.1
     4        https://bugs.webkit.org/show_bug.cgi?id=171612
     5
     6        Reviewed by Mark Lam.
     7
     8        ICU 59.1 has broken source compatibility. Now it defines UChar as
     9        char16_t, which does not allow automatic type conversion from unsigned
     10        short in C++ code.
     11
     12        * Shared/API/c/WKString.cpp:
     13        (WKStringGetCharacters):
     14
    1152017-05-04  Dan Bernstein  <mitz@apple.com>
    216
  • trunk/Source/WebKit2/Shared/API/c/WKString.cpp

    r201863 r216187  
    6262    auto substring = toImpl(stringRef)->stringView().substring(0, unsignedBufferLength);
    6363
    64     substring.getCharactersWithUpconvert(static_cast<UChar*>(buffer));
     64    substring.getCharactersWithUpconvert(reinterpret_cast<UChar*>(buffer));
    6565    return substring.length();
    6666}
  • trunk/Tools/ChangeLog

    r216185 r216187  
     12017-05-04  Konstantin Tokarev  <annulen@yandex.ru>
     2
     3        Fix compilation with ICU 59.1
     4        https://bugs.webkit.org/show_bug.cgi?id=171612
     5
     6        Reviewed by Mark Lam.
     7
     8        ICU 59.1 has broken source compatibility. Now it defines UChar as
     9        char16_t, which does not allow automatic type conversion from unsigned
     10        short in C++ code.
     11
     12        * TestRunnerShared/UIScriptContext/UIScriptContext.cpp:
     13        (UIScriptContext::tryToCompleteUIScriptForCurrentParentCallback):
     14
    1152017-05-04  Andy Estes  <aestes@apple.com>
    216
  • trunk/Tools/TestRunnerShared/UIScriptContext/UIScriptContext.cpp

    r211674 r216187  
    172172
    173173    JSStringRef result = m_uiScriptResultsPendingCompletion.take(m_currentScriptCallbackID);
    174     String scriptResult(JSStringGetCharactersPtr(result), JSStringGetLength(result));
     174    String scriptResult(reinterpret_cast<const UChar*>(JSStringGetCharactersPtr(result)), JSStringGetLength(result));
    175175
    176176    m_delegate.uiScriptDidComplete(scriptResult, m_currentScriptCallbackID);
Note: See TracChangeset for help on using the changeset viewer.