[webkit-changes] [WebKit/WebKit] 883e02: Fix MSVC build

Alex Christensen noreply at github.com
Tue Jan 2 21:19:03 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 883e029e8b6852c5174b04c674ad0a149d1810d0
      https://github.com/WebKit/WebKit/commit/883e029e8b6852c5174b04c674ad0a149d1810d0
  Author: Alex Christensen <achristensen at apple.com>
  Date:   2024-01-02 (Tue, 02 Jan 2024)

  Changed paths:
    M Source/WebCore/PAL/pal/text/TextCodec.cpp
    M Source/WebKit/Scripts/generate-serializers.py
    M Source/WebKit/Scripts/webkit/tests/GeneratedSerializers.cpp
    M Tools/TestWebKitAPI/Tests/WTF/DragonBoxTest.cpp

  Log Message:
  -----------
  Fix MSVC build
https://bugs.webkit.org/show_bug.cgi?id=267017

Reviewed by Don Olmstead.

The default installation of MSVC is slightly different than what EWS is using.
These differences require a few small tweaks to get WebKit to compile.

* Source/WebCore/PAL/pal/text/TextCodec.cpp:
(PAL::TextCodec::getUnencodableReplacement):
%u in printf-like functions doesn't like char32_t in MSVC.  Just cast it to an unsigned.
* Source/WebKit/Scripts/generate-serializers.py:
(generate_impl):
IGNORE_WARNINGS_BEGIN("switch-unreachable") doesn't tell MSVC to ignore the right warning.
Instead, just make the generated code not have a default statement and exit the switch statement.
* Source/WebKit/Scripts/webkit/tests/GeneratedSerializers.cpp:
(WTF::void>):
Update the generated code tests along with the generator.
* Tools/TestWebKitAPI/Tests/WTF/DragonBoxTest.cpp:
(TestWebKitAPI::TEST):
MSVC needs constexpr to be able to allocate arrays on the stack.

Canonical link: https://commits.webkit.org/272595@main




More information about the webkit-changes mailing list