Skip to content

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
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