From cb0dcc340836a64e2d33b27f1be7bc888c084f12 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Fri, 7 Mar 2014 09:46:44 +0100 Subject: [PATCH] w32: Include winsock2.h to silence warnings. --- agent/preset-passphrase.c | 5 ++++- agent/protect.c | 3 +++ common/dns-cert.c | 3 +++ common/estream.c | 3 +++ common/http.c | 3 +++ common/init.c | 7 +++++-- common/iobuf.c | 3 +++ common/logging.c | 3 +++ common/mischelp.h | 3 +++ common/pka.c | 5 ++++- common/srv.c | 5 ++++- common/srv.h | 3 +++ common/stringhelp.c | 3 +++ common/sysutils.c | 3 +++ common/ttyio.c | 3 +++ common/w32-reg.c | 3 +++ dirmngr/ks-engine-hkp.c | 3 +++ g10/exec.c | 5 ++++- g10/gpg.c | 5 ++++- g10/misc.c | 3 +++ g10/photoid.c | 3 +++ 21 files changed, 70 insertions(+), 7 deletions(-) diff --git a/agent/preset-passphrase.c b/agent/preset-passphrase.c index e0cb77ea8..ad8e50047 100644 --- a/agent/preset-passphrase.c +++ b/agent/preset-passphrase.c @@ -38,7 +38,10 @@ #include /* for setmode() */ #endif #ifdef HAVE_W32_SYSTEM -#include /* To initialize the sockets. fixme */ +# ifdef HAVE_WINSOCK2_H +# include +# endif +# include /* To initialize the sockets. fixme */ #endif #define JNLIB_NEED_LOG_LOGV diff --git a/agent/protect.c b/agent/protect.c index 749867cc1..3a0021871 100644 --- a/agent/protect.c +++ b/agent/protect.c @@ -29,6 +29,9 @@ #include #include #ifdef HAVE_W32_SYSTEM +# ifdef HAVE_WINSOCK2_H +# include +# endif # include #else # include diff --git a/common/dns-cert.c b/common/dns-cert.c index 7c1b9c678..179bb1524 100644 --- a/common/dns-cert.c +++ b/common/dns-cert.c @@ -31,6 +31,9 @@ #include #ifdef USE_DNS_CERT # ifdef HAVE_W32_SYSTEM +# ifdef HAVE_WINSOCK2_H +# include +# endif # include # else # include diff --git a/common/estream.c b/common/estream.c index 9c15100f0..be791a802 100644 --- a/common/estream.c +++ b/common/estream.c @@ -79,6 +79,9 @@ #include #include #ifdef HAVE_W32_SYSTEM +# ifdef HAVE_WINSOCK2_H +# include +# endif # include #endif #ifdef HAVE_W32CE_SYSTEM diff --git a/common/http.c b/common/http.c index c4e6ca99d..d2f13e498 100644 --- a/common/http.c +++ b/common/http.c @@ -58,6 +58,9 @@ #include #ifdef HAVE_W32_SYSTEM +# ifdef HAVE_WINSOCK2_H +# include +# endif # include #else /*!HAVE_W32_SYSTEM*/ # include diff --git a/common/init.c b/common/init.c index 8a0b6a8e7..35e623fc2 100644 --- a/common/init.c +++ b/common/init.c @@ -35,10 +35,13 @@ #endif #ifdef HAVE_W32_SYSTEM -#include +# ifdef HAVE_WINSOCK2_H +# include +# endif +# include #endif #ifdef HAVE_NPTH -#include +# include #endif #ifdef HAVE_W32CE_SYSTEM # include /* For _assuan_w32ce_finish_pipe. */ diff --git a/common/iobuf.c b/common/iobuf.c index 71930208c..d78e5d2e2 100644 --- a/common/iobuf.c +++ b/common/iobuf.c @@ -40,6 +40,9 @@ #include #include #ifdef HAVE_W32_SYSTEM +# ifdef HAVE_WINSOCK2_H +# include +# endif # include #endif #ifdef __riscos__ diff --git a/common/logging.c b/common/logging.c index 2b5bb2db1..bdc284fef 100644 --- a/common/logging.c +++ b/common/logging.c @@ -41,6 +41,9 @@ #include #include #ifdef HAVE_W32_SYSTEM +# ifdef HAVE_WINSOCK2_H +# include +# endif # include #else /*!HAVE_W32_SYSTEM*/ # include diff --git a/common/mischelp.h b/common/mischelp.h index a8b16356a..dd1f3a620 100644 --- a/common/mischelp.h +++ b/common/mischelp.h @@ -81,6 +81,9 @@ time_t timegm (struct tm *tm); # include # include #else +# ifdef HAVE_WINSOCK2_H +# include +# endif # include #endif diff --git a/common/pka.c b/common/pka.c index 2b4b9ceff..3c45e8bbf 100644 --- a/common/pka.c +++ b/common/pka.c @@ -36,7 +36,10 @@ #ifdef USE_DNS_PKA #include #ifdef _WIN32 -#include +# ifdef HAVE_WINSOCK2_H +# include +# endif +# include #else #include #include diff --git a/common/srv.c b/common/srv.c index 74afbcb71..380e356bd 100644 --- a/common/srv.c +++ b/common/srv.c @@ -30,7 +30,10 @@ #include #include #ifdef _WIN32 -#include +# ifdef HAVE_WINSOCK2_H +# include +# endif +# include #else #include #include diff --git a/common/srv.h b/common/srv.h index b7d487cef..016d2b1f4 100644 --- a/common/srv.h +++ b/common/srv.h @@ -32,6 +32,9 @@ #ifdef USE_DNS_SRV # ifdef _WIN32 +# ifdef HAVE_WINSOCK2_H +# include +# endif # include # else # include diff --git a/common/stringhelp.c b/common/stringhelp.c index d51d3e0ce..2d2b412dc 100644 --- a/common/stringhelp.c +++ b/common/stringhelp.c @@ -41,6 +41,9 @@ #include #include #ifdef HAVE_W32_SYSTEM +# ifdef HAVE_WINSOCK2_H +# include +# endif # include #endif diff --git a/common/sysutils.c b/common/sysutils.c index f0c2ad8a8..0d92741ec 100644 --- a/common/sysutils.c +++ b/common/sysutils.c @@ -57,6 +57,9 @@ # if WINVER < 0x0500 # define WINVER 0x0500 /* Required for AllowSetForegroundWindow. */ # endif +# ifdef HAVE_WINSOCK2_H +# include +# endif # include #endif #ifdef HAVE_NPTH diff --git a/common/ttyio.c b/common/ttyio.c index a3f63274a..66ca98401 100644 --- a/common/ttyio.c +++ b/common/ttyio.c @@ -53,6 +53,9 @@ #endif #endif #ifdef USE_W32_CONSOLE +# ifdef HAVE_WINSOCK2_H +# include +# endif # include # ifdef HAVE_TCGETATTR # error mingw32 and termios diff --git a/common/w32-reg.c b/common/w32-reg.c index 428705ce9..250717791 100644 --- a/common/w32-reg.c +++ b/common/w32-reg.c @@ -36,6 +36,9 @@ #include #include #include +#ifdef HAVE_WINSOCK2_H +# include +#endif #include #include "libjnlib-config.h" diff --git a/dirmngr/ks-engine-hkp.c b/dirmngr/ks-engine-hkp.c index 8aa891f74..0c131850a 100644 --- a/dirmngr/ks-engine-hkp.c +++ b/dirmngr/ks-engine-hkp.c @@ -25,6 +25,9 @@ #include #include #ifdef HAVE_W32_SYSTEM +# ifdef HAVE_WINSOCK2_H +# include +# endif # include #else /*!HAVE_W32_SYSTEM*/ # include diff --git a/g10/exec.c b/g10/exec.c index 0caa43ba4..b0ff2eafe 100644 --- a/g10/exec.c +++ b/g10/exec.c @@ -33,7 +33,10 @@ #include #endif #ifdef HAVE_DOSISH_SYSTEM -#include +# ifdef HAVE_WINSOCK2_H +# include +# endif +# include #endif #include #include diff --git a/g10/gpg.c b/g10/gpg.c index 65a9cab99..d24cc23a9 100644 --- a/g10/gpg.c +++ b/g10/gpg.c @@ -31,7 +31,10 @@ #endif #include #ifdef HAVE_W32_SYSTEM -#include +# ifdef HAVE_WINSOCK2_H +# include +# endif +# include #endif #define INCLUDED_BY_MAIN_MODULE 1 diff --git a/g10/misc.c b/g10/misc.c index 9c28e5b46..ba83b1910 100644 --- a/g10/misc.c +++ b/g10/misc.c @@ -41,6 +41,9 @@ #ifdef HAVE_W32_SYSTEM #include #include +#ifdef HAVE_WINSOCK2_H +# include +#endif #include #include #ifndef CSIDL_APPDATA diff --git a/g10/photoid.c b/g10/photoid.c index 132adca17..829d36c9e 100644 --- a/g10/photoid.c +++ b/g10/photoid.c @@ -22,6 +22,9 @@ #include #include #ifdef _WIN32 +# ifdef HAVE_WINSOCK2_H +# include +# endif # include # ifndef VER_PLATFORM_WIN32_WINDOWS # define VER_PLATFORM_WIN32_WINDOWS 1