On Sun, May 2, 2010 at 11:11 AM, Bruno Haible <br...@clisp.org> wrote: > Hi, > > Ozkan Sezer wrote: >> The config header checks for windows' ws2tcpip.h have a little bug where >> they do not include winsock2.h before ws2tcpip.h: ws2tcpip.h requires >> winsock2.h to be included before, a plain AC_CHECK_HEADERS([ws2tcpip.h]) >> like in current m4/sys_socket_h.m4 may fail to detect the header's >> presence. A solution may be changing the CFLAGS temporarily by adding >> "-include winsock2.h" to it. > > Which platform are you talking about? On mingw (both the one in Cygwin 1.5.x > as well as the one in Cygwin 1.7.2) a file > > #include "ws2tcpip.h" > > compiles fine: $ gcc -mno-cygwin -c foo.c
It is mingw-w64 (http://mingw-w64.sourceforge.net/) where the provided ws2tcpip.h header doesn't include winsock2.h. The mingw32 header does include it, for convenience as it seems, which is why it works for you. We (mingw-w64) can do the same for convenience if it is truly necessary, although the problem is that not every header from every source have to do it that way. -- Ozkan