Bug 247156 - [WinCairo][32bit] wtf/ByteOrder.h(56): error C2373: 'ntohs': redefinition; different type modifiers
Summary: [WinCairo][32bit] wtf/ByteOrder.h(56): error C2373: 'ntohs': redefinition; di...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-27 17:10 PDT by Fujii Hironori
Modified: 2023-11-27 01:20 PST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fujii Hironori 2022-10-27 17:10:57 PDT
[WinCairo][32bit] wtf/ByteOrder.h(56): error C2373: 'ntohs': redefinition; different type modifiers

"perl .\Tools\Scripts\build-webkit --wincairo --32-bit" reports the following compilation error.

> C:\home\webkit\gc\WebKitBuild\Release\WTF\Headers\wtf/ByteOrder.h(56): error C2373: 'ntohs': redefinition; different type modifiers
> C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(1985): note: see declaration of 'ntohs'
> C:\home\webkit\gc\WebKitBuild\Release\WTF\Headers\wtf/ByteOrder.h(56): error C2491: 'ntohs': definition of dllimport function not allowed
> C:\home\webkit\gc\WebKitBuild\Release\WTF\Headers\wtf/ByteOrder.h(57): error C2373: 'htons': redefinition; different type modifiers
> C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um\winsock2.h(1813): note: see declaration of 'htons'
> C:\home\webkit\gc\WebKitBuild\Release\WTF\Headers\wtf/ByteOrder.h(57): error C2491: 'htons': definition of dllimport function not allowed

JavaScriptCore/inspector/remote/socket/RemoteInspectorSocket.h has #include <winsock2.h>.
Comment 1 June 2023-11-27 01:20:33 PST
I also encountered this problem. I downloaded the 'WebKitRequirementsWin32.zip' manually, and using camke and msbuild like below:
1. cmake -G "Visual Studio 17 2022" -A Win32 -DCMAKE_SYSTEM_VERSION=10.0.22621.0 -DCMAKE_BUILD_TYPE=Release -DRUBY_LIBRARY=C:\tools\ruby26\lib -DPORT="WinCairo" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DSHOW_BINDINGS_GENERATION_PROGRESS=1 -DDEVELOPER_MODE=ON -DENABLE_EXPERIMENTAL_FEATURES=ON .. 2>&1
2. msbuild /p:Platform=Win32 /p:Configuration=Release WebKit.sln /t:Rebuild 2>&1

error log:
F:\gitP\WebKit\webkit\build_x86_WinCairo\WTF\Headers\wtf/ByteOrder.h(56,17): error C2373: 'ntohs': redefinition; different type modifiers (compiling source file F:\gitP\WebKit\webkit\build_x86_WinCairo\JavaScriptCore\DerivedSources\unified-sources\UnifiedSource-84c9f43f-6.cpp) [F:\gitP\WebKit\webkit\build_x86_WinCairo\Source\JavaScriptCore\JavaScriptCore.vcxproj]
  F:\gitP\WebKit\webkit\build_x86_WinCairo\WTF\Headers\wtf/ByteOrder.h(56,17): error C2491: 'ntohs': definition of dllimport function not allowed (compiling source file F:\gitP\WebKit\webkit\build_x86_WinCairo\JavaScriptCore\DerivedSources\unified-sources\UnifiedSource-84c9f43f-6.cpp) [F:\gitP\WebKit\webkit\build_x86_WinCairo\Source\JavaScriptCore\JavaScriptCore.vcxproj]
  F:\gitP\WebKit\webkit\build_x86_WinCairo\WTF\Headers\wtf/ByteOrder.h(57,17): error C2373: 'htons': redefinition; different type modifiers (compiling source file F:\gitP\WebKit\webkit\build_x86_WinCairo\JavaScriptCore\DerivedSources\unified-sources\UnifiedSource-84c9f43f-6.cpp) [F:\gitP\WebKit\webkit\build_x86_WinCairo\Source\JavaScriptCore\JavaScriptCore.vcxproj]
  F:\gitP\WebKit\webkit\build_x86_WinCairo\WTF\Headers\wtf/ByteOrder.h(57,17): error C2491: 'htons': definition of dllimport function not allowed (compiling source file F:\gitP\WebKit\webkit\build_x86_WinCairo\JavaScriptCore\DerivedSources\unified-sources\UnifiedSource-84c9f43f-6.cpp) [F:\gitP\WebKit\webkit\build_x86_WinCairo\Source\JavaScriptCore\JavaScriptCore.vcxproj]