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.
Remove the
#ifdef __MINGW32__
implementations ofinet_ntop
andinet_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 ofinet_ntop
be asize_t
) which prevents compilation of the library on mingw.Cast
INVALID_SOCKET
to auint32_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.