socket abstraction: slirp_os_socket
Use a typedef to abstract socket identifiers because Windows just has to be different (SOCKET type.) SOCKET on Win64 is 64-bits and generates copious type slicing warnings.
-
has_valid_socket(), not_valid_socket(): Replaces
(s >= 0)
and(s < 0)
on socket validity tests. -
SLIRP_INVALID_SOCKET
: Cross-platform value for invalid/closed/uninitialized sockets. -
Win32/Win64: Ensure that errno.h is always included. If not included, errno is #define-ed as WSAGetLastError(); errno.h #define-s errno as a function, i.e., "*errno()".
-
libslirp-util.h: Export slirp_inet_aton() and win32_socket_error() utility functions for Win32/64.