Fix 'Please include winsock2.h before windows.h' warnings with mingw32
authorJussi Kivilinna <jussi.kivilinna@iki.fi>
Wed, 26 Jun 2013 12:28:49 +0000 (15:28 +0300)
committerJussi Kivilinna <jussi.kivilinna@iki.fi>
Wed, 10 Jul 2013 19:02:08 +0000 (22:02 +0300)
* random/rndw32.c: include winsock2.h before windows.h.
* src/ath.h [_WIN32]: Ditto.
* tests/benchmark.c [_WIN32]: Ditto.
--

Patch silences warnings of following type:
/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/winsock2.h:15:2: warning: #warning Please include winsock2.h before windows.h [-Wcpp]

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
random/rndw32.c
src/ath.h
tests/benchmark.c

index f8a83b6..5c5d6c6 100644 (file)
@@ -78,6 +78,7 @@
 #include <stdint.h>
 #endif
 
+#include <winsock2.h>
 #include <windows.h>
 
 
index 6ffa928..a132e0b 100644 (file)
--- a/src/ath.h
+++ b/src/ath.h
@@ -23,6 +23,7 @@
 #include <config.h>
 
 #ifdef _WIN32
+# include <winsock2.h>
 # include <windows.h>
 #else /* !_WIN32 */
 # ifdef HAVE_SYS_SELECT_H
index c4b5258..79048a3 100644 (file)
@@ -25,6 +25,7 @@
 #include <time.h>
 #include <stdarg.h>
 #ifdef _WIN32
+#include <winsock2.h>
 #include <windows.h>
 #else
 #include <sys/times.h>