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

Remove redundant MinGW inet_ntop and inet_pton, fix INVALID_SOCKET tautology #122

Merged
merged 1 commit into from
Mar 11, 2024

Conversation

cshenton
Copy link
Contributor

@cshenton cshenton commented Mar 11, 2024

Remove the #ifdef __MINGW32__ implementations of inet_ntop and inet_pton.

These are already a part of mingw headers and the conflicting definition of typedef int socklen_t causes a conflict with the windows headers (which have the final argument of inet_ntop be a size_t) which prevents compilation of the library on mingw.

Cast INVALID_SOCKET to a uint32_t to avoid compilers optimizing away the uint32 to uint64 comparison. This will just truncate the bits and give us ~(uint32_t)0 which is the desired behaviour, and also suppresses the associated compiler warning.

@gafferongames gafferongames merged commit 2f70334 into mas-bandwidth:main Mar 11, 2024
6 checks passed
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.

2 participants