I have a C program that uses getaddrinfo(). It works as expected on Linux and Mac OS X.
I\'m in the middle of porting it to Windows.
When I comp
If you want to make your code compiler-wide you should actually also define NTDDI_VERSION with the same OS version as _WIN32_WINNT. Without that defining only _WIN32_WINNT will not let you to use getaddrinfo() with some compilers (i.e. Watcom). It is better to wrap it in the same way as Windows SDK does:
#define _NTDDI_VERSION_FROM_WIN32_WINNT2(ver) ver##0000
#define _NTDDI_VERSION_FROM_WIN32_WINNT(ver) _NTDDI_VERSION_FROM_WIN32_WINNT2(ver)
#ifndef _WIN32_WINNT
# define _WIN32_WINNT 0x501
#endif
#ifndef NTDDI_VERSION
# define NTDDI_VERSION _NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT)
#endif