From a77b5b7b6ec4298451ec3dceede34506234a76ba Mon Sep 17 00:00:00 2001 From: Cameron Cawley Date: Sun, 30 Jan 2022 13:48:23 +0000 Subject: [PATCH] Restore support for building with Winsock 1.1 --- SDLnet.c | 3 +++ SDLnetsys.h | 7 +++++++ VisualC/SDL_net_VS2008.vcproj | 8 ++++---- configure.ac | 11 ++++++++++- 4 files changed, 24 insertions(+), 5 deletions(-) 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 @@