# define _SOCKADDR_LEN
#endif
-#if defined(HAS_SOCKET) && !defined(VMS) /* VMS handles sockets via vmsish.h */
+#if defined(HAS_SOCKET) && !defined(VMS) && !defined(WIN32) /* VMS/WIN32 handle sockets via vmsish.h/win32.h */
# include <sys/socket.h>
# if defined(USE_SOCKS) && defined(I_SOCKS)
# if !defined(INCLUDE_PROTOTYPES)
#include <windows.h>
#include <winsock.h>
+#include "win32.h"
+
#define ENOTSOCK WSAENOTSOCK
#ifdef USE_SOCKETS_AS_HANDLES