Skip to content

fix(generator): cast frame.LEN in min() so WS read compiles under MSVC#37

Open
binaryduke wants to merge 1 commit into
NodeppOfficial:devfrom
binaryduke:fix/msvc-generator-min
Open

fix(generator): cast frame.LEN in min() so WS read compiles under MSVC#37
binaryduke wants to merge 1 commit into
NodeppOfficial:devfrom
binaryduke:fix/msvc-generator-min

Conversation

@binaryduke

Copy link
Copy Markdown

generator.h (WebSocket frame read) calls min( sx, frame.LEN ), mixing ulong
(sx) and uchar_64 (frame.LEN). With the namespaced min<T> from #32, template
argument deduction fails on this mismatch under MSVC 2022 (/std:c++20), so the
WebSocket translation unit does not build on Windows.

One-line cast resolves it, matching the existing style elsewhere in this file
(e.g. the other min() call sites already cast their arguments):

while ( frame.LEN > 0 ){ sz = min( sx, (ulong) frame.LEN );

Verified: with this cast, dev builds clean on MSVC 2022 x64 /std:c++20 /MT and
the #36 WebSocket connect path runs (see the #36 confirmation).

generator.h WebSocket frame read calls min( sx, frame.LEN ), mixing ulong (sx)
and uchar_64 (frame.LEN). With the namespaced min<T> from NodeppOfficial#32, template argument
deduction fails on this mismatch under MSVC 2022 (/std:c++20), so the WebSocket
translation unit does not build on Windows.

One-line cast resolves it, matching the existing cast style at other min() call
sites in this file. Verified: dev builds clean on MSVC 2022 x64 /std:c++20 /MT
and the NodeppOfficial#36 WebSocket connect path runs.
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