Modified: trunk/ChangeLog (237788 => 237789)
--- trunk/ChangeLog 2018-11-05 04:29:02 UTC (rev 237788)
+++ trunk/ChangeLog 2018-11-05 04:38:32 UTC (rev 237789)
@@ -1,3 +1,16 @@
+2018-11-04 Fujii Hironori <[email protected]>
+
+ [Win] Use C++14, not C++17
+ https://bugs.webkit.org/show_bug.cgi?id=191101
+
+ Reviewed by Alex Christensen.
+
+ Based on the webkit-dev discussion, this change switches Windows
+ port from C++17 to C++14.
+ <https://lists.webkit.org/pipermail/webkit-dev/2018-September/030186.html>
+
+ * Source/cmake/OptionsMSVC.cmake: Replaced /std:c++17 with /std:c++14 switch.
+
2018-10-30 Don Olmstead <[email protected]>
[PlayStation] Enable _javascript_Core
Modified: trunk/Source/WTF/ChangeLog (237788 => 237789)
--- trunk/Source/WTF/ChangeLog 2018-11-05 04:29:02 UTC (rev 237788)
+++ trunk/Source/WTF/ChangeLog 2018-11-05 04:38:32 UTC (rev 237789)
@@ -1,3 +1,13 @@
+2018-11-04 Fujii Hironori <[email protected]>
+
+ [Win] Use C++14, not C++17
+ https://bugs.webkit.org/show_bug.cgi?id=191101
+
+ Reviewed by Alex Christensen.
+
+ * wtf/StdLibExtras.h: Use _MSVC_LANG to check C++ language version
+ instead of _MSC_FULL_VER.
+
2018-11-02 Justin Fan <[email protected]>
[WebGPU] Experimental prototype for MSL shaders
Modified: trunk/Source/WTF/wtf/StdLibExtras.h (237788 => 237789)
--- trunk/Source/WTF/wtf/StdLibExtras.h 2018-11-05 04:29:02 UTC (rev 237788)
+++ trunk/Source/WTF/wtf/StdLibExtras.h 2018-11-05 04:38:32 UTC (rev 237789)
@@ -527,7 +527,7 @@
// Provide in_place_t when not building with -std=c++17, or when building with libstdc++ 6
// (which doesn't define the _GLIBCXX_RELEASE macro that's been introduced in libstdc++ 7).
-#if (__cplusplus < 201703L || (defined(__GLIBCXX__) && !defined(_GLIBCXX_RELEASE))) && (!defined(_MSC_FULL_VER) || _MSC_FULL_VER < 190023918)
+#if (__cplusplus < 201703L || (defined(__GLIBCXX__) && !defined(_GLIBCXX_RELEASE))) && (!defined(_MSVC_LANG) || _MSVC_LANG < 201703L)
// These are inline variable for C++17 and later.
#define __IN_PLACE_INLINE_VARIABLE static const
Modified: trunk/Source/cmake/OptionsMSVC.cmake (237788 => 237789)
--- trunk/Source/cmake/OptionsMSVC.cmake 2018-11-05 04:29:02 UTC (rev 237788)
+++ trunk/Source/cmake/OptionsMSVC.cmake 2018-11-05 04:38:32 UTC (rev 237789)
@@ -26,9 +26,9 @@
add_definitions(-D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1)
endif ()
-# Enable C++17
+# Enable C++14
# https://docs.microsoft.com/en-us/cpp/build/reference/std-specify-language-standard-version
-add_compile_options(/std:c++17)
+add_compile_options(/std:c++14)
# Specify the source code encoding
add_compile_options(/utf-8 /validate-charset)
Modified: trunk/Tools/ChangeLog (237788 => 237789)
--- trunk/Tools/ChangeLog 2018-11-05 04:29:02 UTC (rev 237788)
+++ trunk/Tools/ChangeLog 2018-11-05 04:38:32 UTC (rev 237789)
@@ -1,3 +1,17 @@
+2018-11-04 Fujii Hironori <[email protected]>
+
+ [Win] Use C++14, not C++17
+ https://bugs.webkit.org/show_bug.cgi?id=191101
+
+ Reviewed by Alex Christensen.
+
+ std::basic_string::data() returns a read-only const buffer in
+ C++14.
+
+ * MiniBrowser/win/WebKitBrowserWindow.cpp:
+ (createString): Use std::vector instead of std::wstring.
+ (createUTF8String): Use std::vector instead of std::string.
+
2018-11-04 Wenson Hsieh <[email protected]>
[Cocoa] Fold common UIScriptController functionality on macOS and iOS into UIScriptControllerCocoa.mm
Modified: trunk/Tools/MiniBrowser/win/WebKitBrowserWindow.cpp (237788 => 237789)
--- trunk/Tools/MiniBrowser/win/WebKitBrowserWindow.cpp 2018-11-05 04:29:02 UTC (rev 237788)
+++ trunk/Tools/MiniBrowser/win/WebKitBrowserWindow.cpp 2018-11-05 04:38:32 UTC (rev 237789)
@@ -37,11 +37,10 @@
std::wstring createString(WKStringRef wkString)
{
size_t maxSize = WKStringGetLength(wkString);
- std::wstring str(maxSize, '\0');
- size_t actualLength = WKStringGetCharacters(wkString, str.data(), maxSize);
- if (maxSize != actualLength)
- str.resize(actualLength);
- return std::wstring(str.data());
+
+ std::vector<WKChar> wkCharBuffer(maxSize);
+ size_t actualLength = WKStringGetCharacters(wkString, wkCharBuffer.data(), maxSize);
+ return std::wstring(wkCharBuffer.data(), actualLength);
}
std::wstring createString(WKURLRef wkURL)
@@ -53,11 +52,9 @@
std::string createUTF8String(const wchar_t* src, size_t srcLength)
{
int length = WideCharToMultiByte(CP_UTF8, 0, src, srcLength, 0, 0, nullptr, nullptr);
- std::string str(length, '\0');
- int actualLength = WideCharToMultiByte(CP_UTF8, 0, src, srcLength, str.data(), length, nullptr, nullptr);
- if (length != actualLength)
- str.resize(actualLength);
- return str;
+ std::vector<char> buffer(length);
+ size_t actualLength = WideCharToMultiByte(CP_UTF8, 0, src, srcLength, buffer.data(), length, nullptr, nullptr);
+ return { buffer.data(), actualLength };
}
WKRetainPtr<WKStringRef> createWKString(_bstr_t str)