diff --git a/SDLnet.c b/SDLnet.c index a79974b..cb714a6 100644 --- a/SDLnet.c +++ b/SDLnet.c @@ -106,6 +106,9 @@ void SDLNet_Quit(void) /* Clean up windows networking */ if ( WSACleanup() == SOCKET_ERROR ) { if ( WSAGetLastError() == WSAEINPROGRESS ) { +#ifndef __USE_WINSOCK2 + WSACancelBlockingCall(); +#endif WSACleanup(); } } diff --git a/SDLnetsys.h b/SDLnetsys.h index 2494879..1f8886e 100644 --- a/SDLnetsys.h +++ b/SDLnetsys.h @@ -33,8 +33,15 @@ /* Include system network headers */ #if defined(__WIN32__) || defined(WIN32) #define __USE_W32_SOCKETS +#ifdef __USE_WINSOCK2 #include #include +#else +#include +/* NOTE: windows socklen_t is signed + * and is defined only for winsock2. */ +typedef int socklen_t; +#endif #include #else /* UNIX */ #ifdef __OS2__ diff --git a/VisualC/SDL_net_VS2008.vcproj b/VisualC/SDL_net_VS2008.vcproj index ed858ed..aa1907a 100644 --- a/VisualC/SDL_net_VS2008.vcproj +++ b/VisualC/SDL_net_VS2008.vcproj @@ -51,7 +51,7 @@