Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include Winsock header only where it's actually used #1472

Merged
merged 3 commits into from
Aug 19, 2023

Conversation

dgelessus
Copy link
Contributor

pnNetCommon is also the only library that actually links with Winsock, so including the header elsewhere doesn't make much sense.

pnNetCommon is also the only library that actually links with Winsock,
so including the header elsewhere doesn't make much sense.
Although AF_INET is always 2 on every relevant system, it's better not
to assume this. Here, we use AF_INET only as a marker value in a
serialization format and never pass it to any system functions, so it's
more important that the value is consistent between systems than that it
matches the system constant.
Only has kInet (AF_INET, IPv4) for now. This will be relevant if IPv6
support is ever added here - unlike AF_INET, which is 2 on all relevant
OSes, AF_INET6 has a different value on Windows, macOS, and Linux.
@Hoikas Hoikas merged commit d3092a1 into H-uru:master Aug 19, 2023
14 checks passed
@dgelessus dgelessus deleted the dont_include_winsock_everywhere branch November 29, 2023 21:30
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.

3 participants