Skip to content

GDK: add ASIO_DISABLE_SERIAL_PORT to per-file websocketpp_websocket.cpp defines (follow-up to #987)#988

Open
v-patrickpe wants to merge 1 commit into
microsoft:mainfrom
v-patrickpe:user/v-patrickpe/gdk-websocketpp-asio-disable-serial-port
Open

GDK: add ASIO_DISABLE_SERIAL_PORT to per-file websocketpp_websocket.cpp defines (follow-up to #987)#988
v-patrickpe wants to merge 1 commit into
microsoft:mainfrom
v-patrickpe:user/v-patrickpe/gdk-websocketpp-asio-disable-serial-port

Conversation

@v-patrickpe
Copy link
Copy Markdown
Contributor

What

Add ASIO_DISABLE_SERIAL_PORT to the per-file PreprocessorDefinitions override on websocketpp_websocket.cpp in both Build/libHttpClient.Win32.Shared/libHttpClient.Win32.Shared.vcxitems and Build/libHttpClient.GDK.Shared/libHttpClient.GDK.Shared.vcxitems.

Why

PR #987 set ASIO_DISABLE_SERIAL_PORT in Build/libHttpClient.GDK.props:114 (ItemDefinitionGroup ClCompile PreprocessorDefinitions). That should have suppressed the body of asio/serial_port_base.hpp on GDK (where WINAPI_FAMILY=WINAPI_FAMILY_GAMES strips DCB and friends).

But it didn't. The per-file <ClCompile Include="...websocketpp_websocket.cpp"> overrides set their own PreprocessorDefinitions list using %(PreprocessorDefinitions). That %(...) does not inherit the project's ItemDefinitionGroup defaults when the override is sourced from an <Import Label="Shared"> shared-items file. The actual CL.exe invocation for this TU on GDK was missing /D ASIO_DISABLE_SERIAL_PORT:

... /D _CRT_SECURE_NO_WARNINGS /D _CRT_NONSTDC_NO_WARNINGS /D _WEBSOCKETPP_CPP11_STL_
    /D _WEBSOCKETPP_CPP11_RANDOM_DEVICE_ /D HC_ENABLE_WEBSOCKET_COMPRESSION=1
    /D HC_DATAMODEL=HC_DATAMODEL_LLP64 /D HC_PLATFORM=HC_PLATFORM_WIN32 ...
    websocketpp_websocket.cpp

So serial_port_base.hpp(58,9) still compiled and failed with:

error C2061: syntax error: identifier 'DCB'
error C4430: missing type specifier - int assumed
error C2143: syntax error: missing ',' before '&'
error C2065: 'storage': undeclared identifier (serial_port_base.ipp:507)
error C2065: 'ec': undeclared identifier (serial_port_base.ipp:507)

How

Add ASIO_DISABLE_SERIAL_PORT to both per-file overrides, with a comment explaining why the inheritance gap forces this duplication. Defined unconditionally - asio's serial-port transport is unused by the websocketpp provider on every platform we ship, so the Win32 entry getting the same define is harmless.

Repro / validation

Surfaced by PlayFab.SDKs.All TestDrop 148864603 (microsoft/Xbox ADO def 137186) against libHttpClient e79302c (PR #987 squash). All four GDK jobs (x64/ARM64 x Debug/Release) failed at this exact point. Once this fix is in and the consumer bumps the submodule, GDK is expected to go green.

Notes

…pp defines

PR microsoft#987 set ASIO_DISABLE_SERIAL_PORT in Build/libHttpClient.GDK.props
ItemDefinitionGroup ClCompile PreprocessorDefinitions, but the per-file
override on websocketpp_websocket.cpp (Win32.Shared.vcxitems:32 and
GDK.Shared.vcxitems:39) uses %(PreprocessorDefinitions) - which does NOT
inherit the project ItemDefinitionGroup defaults across shared-items
imports. The actual CL.exe command for that TU on GDK was missing
/D ASIO_DISABLE_SERIAL_PORT (verified in PFSDKAll TestDrop 148864603
GDK x64_Debug log), so serial_port_base.hpp still compiled and failed
with C2061 'DCB' / C2065 'storage'/'ec' on GDK where WINAPI_FAMILY_GAMES
strips DCB.

Add the define unconditionally to both per-file overrides. Safe for
Win32 too - asio serial-port transport is unused by the websocketpp
provider on every platform we ship.

Follow-up to microsoft#987. Surfaced by PFSDKAll TestDrop 148864603 against
libHttpClient e79302c.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@v-patrickpe
Copy link
Copy Markdown
Contributor Author

ADO bug: AB#62596841

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant