From 2479e06848a7625b1b55511b43f86abc3a76c93d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 3 Mar 2004 13:32:56 +0000 Subject: David Byron's work on making libcurl only require winsock 1.1 on Windows machines. --- lib/easy.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'lib/easy.c') diff --git a/lib/easy.c b/lib/easy.c index 5ecd10575..4c4e271f6 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -98,7 +98,12 @@ static CURLcode win32_init(void) WORD wVersionRequested; WSADATA wsaData; int err; - wVersionRequested = MAKEWORD(2, 0); + +#ifdef ENABLE_IPV6 + wVersionRequested = MAKEWORD(2, 0); +#else + wVersionRequested = MAKEWORD(1, 1); +#endif err = WSAStartup(wVersionRequested, &wsaData); @@ -107,14 +112,14 @@ static CURLcode win32_init(void) /* winsock.dll. */ return CURLE_FAILED_INIT; - /* Confirm that the Windows Sockets DLL supports 2.0.*/ + /* Confirm that the Windows Sockets DLL supports what we need.*/ /* Note that if the DLL supports versions greater */ - /* than 2.0 in addition to 2.0, it will still return */ - /* 2.0 in wVersion since that is the version we */ - /* requested. */ - - if ( LOBYTE( wsaData.wVersion ) != 2 || - HIBYTE( wsaData.wVersion ) != 0 ) { + /* than wVersionRequested, it will still return */ + /* wVersionRequested in wVersion. wHighVersion contains the */ + /* highest supported version. */ + + if ( LOBYTE( wsaData.wVersion ) != LOBYTE(wVersionRequested) || + HIBYTE( wsaData.wVersion ) != HIBYTE(wVersionRequested) ) { /* Tell the user that we couldn't find a useable */ /* winsock.dll. */ -- cgit v1.2.3