Attached patch to windows.h include winsock2.h rather than winsock.h if (_WIN32_WINNT >= 0x0400) && (__W32API_MAJOR_VERSION > 0).
mswsock.h is not included by default. See http://www.sockets.com/mswsock.htm, Note 11 to table.
diff file
diff file