Skip to content

mingw build: alias CMSG_LEN like the other cmsg accessors - #423

Open
tycho wants to merge 1 commit into
ValveSoftware:masterfrom
tycho:fix-mingw-build
Open

mingw build: alias CMSG_LEN like the other cmsg accessors#423
tycho wants to merge 1 commit into
ValveSoftware:masterfrom
tycho:fix-mingw-build

Conversation

@tycho

@tycho tycho commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

The MinGW compatibility block maps cmsghdr, CMSG_FIRSTHDR, and CMSG_NXTHDR (and, just below, CMSG_DATA) to their WSA_-prefixed forms, but not CMSG_LEN. MSVC builds work regardless because its ws2def.h happens to define the unprefixed CMSG_LEN; mingw-w64's headers only provide WSA_CMSG_LEN, so the IP_TOS / IPV6_TCLASS cmsg_len checks in the recvmsg path fail to compile:

error: 'CMSG_LEN' was not declared in this scope

Alias it alongside the others.

The MinGW compatibility block maps cmsghdr, CMSG_FIRSTHDR, and
CMSG_NXTHDR (and, just below, CMSG_DATA) to their WSA_-prefixed forms,
but not CMSG_LEN. MSVC builds work regardless because its ws2def.h
happens to define the unprefixed CMSG_LEN; mingw-w64's headers only
provide WSA_CMSG_LEN, so the IP_TOS / IPV6_TCLASS cmsg_len checks in the
recvmsg path fail to compile:

  error: 'CMSG_LEN' was not declared in this scope

Alias it alongside the others.

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
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