fix compiler warnings about including winsock2.h before windows.h
authorLee <ler762@users.sourceforge.net>
Mon, 14 Dec 2020 14:11:30 +0000 (09:11 -0500)
committerLee <ler762@users.sourceforge.net>
Mon, 14 Dec 2020 14:11:30 +0000 (09:11 -0500)
getting plenty too many of these warnings:
i686-w64-mingw32-gcc -c -pipe -O2 -Wshadow -DWINVER=0x501   -mwindows -Wall -Ipcre  actions.c -o actions.o
In file included from /usr/i686-w64-mingw32/sys-root/mingw/include/ws2tcpip.h:17,
                 from project.h:95,
                 from actions.c:46:
/usr/i686-w64-mingw32/sys-root/mingw/include/winsock2.h:15:2: warning: #warning Please include winsock2.h before windows.h [-Wcpp]
   15 | #warning Please include winsock2.h before windows.h
      |  ^~~~~~~
i686-w64-mingw32-gcc -c -pipe -O2 -Wshadow -DWINVER=0x501   -mwindows -Wall -Ipcre  cgi.c -o cgi.o
In file included from /usr/i686-w64-mingw32/sys-root/mingw/include/ws2tcpip.h:17,
                 from project.h:95,
                 from cgi.c:52:
/usr/i686-w64-mingw32/sys-root/mingw/include/winsock2.h:15:2: warning: #warning Please include winsock2.h before windows.h [-Wcpp]
   15 | #warning Please include winsock2.h before windows.h
      |  ^~~~~~~
i686-w64-mingw32-gcc -c -pipe -O2 -Wshadow -DWINVER=0x501   -mwindows -Wall -Ipcre  cgiedit.c -o cgiedit.o
In file included from /usr/i686-w64-mingw32/sys-root/mingw/include/ws2tcpip.h:17,
                 from project.h:95,
                 from cgiedit.c:57:
/usr/i686-w64-mingw32/sys-root/mingw/include/winsock2.h:15:2: warning: #warning Please include winsock2.h before windows.h [-Wcpp]
   15 | #warning Please include winsock2.h before windows.h
      |  ^~~~~~~

project.h

index 43792dd..14b957f 100644 (file)
--- a/project.h
+++ b/project.h
    typedef pthread_mutex_t privoxy_mutex_t;
 #else
 #  ifdef _WIN32
+#     include <winsock2.h>
+      /* without winsock2.h I get lots of compiler warnings about
+       * #warning Please include winsock2.h before windows.h
+       */
 #     include <windows.h>
 #  endif
    typedef CRITICAL_SECTION privoxy_mutex_t;