diff options
author | Daniel Stenberg <daniel@haxx.se> | 2004-03-03 13:32:56 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2004-03-03 13:32:56 +0000 |
commit | 2479e06848a7625b1b55511b43f86abc3a76c93d (patch) | |
tree | 5f229a8dad5a33c0d0698e2474b943203b38a5c1 /lib/easy.c | |
parent | f2abe03fcf09acc3727e995c3304dc80caea39f5 (diff) |
David Byron's work on making libcurl only require winsock 1.1 on Windows
machines.
Diffstat (limited to 'lib/easy.c')
-rw-r--r-- | lib/easy.c | 21 |
1 files changed, 13 insertions, 8 deletions
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. */ |