Support for getaddrinfo on older versions of Windows

The getaddrinfo function was added to the Ws2_32.dll on Windows XP and
later. To execute an application that uses this function on earlier
versions of Windows, then you need to include the Ws2tcpip.h and
Wspiapi.h files. When the Wspiapi.h include file is added, the
getaddrinfo function is defined to the WspiapiGetAddrInfo inline
function in the Wspiapi.h file. At runtime, the WspiapiGetAddrInfo
function is implemented in such a way that if the Ws2_32.dll or the
Wship6.dll (the file containing getaddrinfo in the IPv6 Technology
Preview for Windows 2000) does not include getaddrinfo, then a version
of getaddrinfo is implemented inline based on code in the Wspiapi.h
header file. This inline code will be used on older Windows platforms
that do not natively support the getaddrinfo function.

The IPv6 protocol is supported on Windows 2000 when the IPv6
Technology Preview for Windows 2000 is installed. Otherwise
getaddrinfo support on versions of Windows earlier than Windows XP is
limited to handling IPv4 name resolution.

The GetAddrInfoW function is the Unicode version of getaddrinfo. The
GetAddrInfoW function was added to the Ws2_32.dll in Windows XP with
Service Pack 2 (SP2). The GetAddrInfoW function cannot be used on
versions of Windows earlier than Windows XP with SP2.
