w32: Include winsock2.h to silence warnings.
authorWerner Koch <wk@gnupg.org>
Fri, 7 Mar 2014 08:46:44 +0000 (09:46 +0100)
committerWerner Koch <wk@gnupg.org>
Fri, 7 Mar 2014 13:18:43 +0000 (14:18 +0100)
21 files changed:
agent/preset-passphrase.c
agent/protect.c
common/dns-cert.c
common/estream.c
common/http.c
common/init.c
common/iobuf.c
common/logging.c
common/mischelp.h
common/pka.c
common/srv.c
common/srv.h
common/stringhelp.c
common/sysutils.c
common/ttyio.c
common/w32-reg.c
dirmngr/ks-engine-hkp.c
g10/exec.c
g10/gpg.c
g10/misc.c
g10/photoid.c

index e0cb77e..ad8e500 100644 (file)
 #include <fcntl.h> /* for setmode() */
 #endif
 #ifdef HAVE_W32_SYSTEM
 #include <fcntl.h> /* for setmode() */
 #endif
 #ifdef HAVE_W32_SYSTEM
-#include <windows.h>  /* To initialize the sockets.  fixme */
+# ifdef HAVE_WINSOCK2_H
+#  include <winsock2.h>
+# endif
+# include <windows.h>  /* To initialize the sockets.  fixme */
 #endif
 
 #define JNLIB_NEED_LOG_LOGV
 #endif
 
 #define JNLIB_NEED_LOG_LOGV
index 749867c..3a00218 100644 (file)
@@ -29,6 +29,9 @@
 #include <unistd.h>
 #include <sys/stat.h>
 #ifdef HAVE_W32_SYSTEM
 #include <unistd.h>
 #include <sys/stat.h>
 #ifdef HAVE_W32_SYSTEM
+# ifdef HAVE_WINSOCK2_H
+#  include <winsock2.h>
+# endif
 # include <windows.h>
 #else
 # include <sys/times.h>
 # include <windows.h>
 #else
 # include <sys/times.h>
index 7c1b9c6..179bb15 100644 (file)
@@ -31,6 +31,9 @@
 #include <sys/types.h>
 #ifdef USE_DNS_CERT
 # ifdef HAVE_W32_SYSTEM
 #include <sys/types.h>
 #ifdef USE_DNS_CERT
 # ifdef HAVE_W32_SYSTEM
+#  ifdef HAVE_WINSOCK2_H
+#   include <winsock2.h>
+#  endif
 #  include <windows.h>
 # else
 #  include <netinet/in.h>
 #  include <windows.h>
 # else
 #  include <netinet/in.h>
index 9c15100..be791a8 100644 (file)
@@ -79,6 +79,9 @@
 #include <stddef.h>
 #include <assert.h>
 #ifdef HAVE_W32_SYSTEM
 #include <stddef.h>
 #include <assert.h>
 #ifdef HAVE_W32_SYSTEM
+# ifdef HAVE_WINSOCK2_H
+#  include <winsock2.h>
+# endif
 # include <windows.h>
 #endif
 #ifdef HAVE_W32CE_SYSTEM
 # include <windows.h>
 #endif
 #ifdef HAVE_W32CE_SYSTEM
index c4e6ca9..d2f13e4 100644 (file)
@@ -58,6 +58,9 @@
 #include <unistd.h>
 
 #ifdef HAVE_W32_SYSTEM
 #include <unistd.h>
 
 #ifdef HAVE_W32_SYSTEM
+# ifdef HAVE_WINSOCK2_H
+#  include <winsock2.h>
+# endif
 # include <windows.h>
 #else /*!HAVE_W32_SYSTEM*/
 # include <sys/types.h>
 # include <windows.h>
 #else /*!HAVE_W32_SYSTEM*/
 # include <sys/types.h>
index 8a0b6a8..35e623f 100644 (file)
 #endif
 
 #ifdef HAVE_W32_SYSTEM
 #endif
 
 #ifdef HAVE_W32_SYSTEM
-#include <windows.h>
+# ifdef HAVE_WINSOCK2_H
+#  include <winsock2.h>
+# endif
+# include <windows.h>
 #endif
 #ifdef HAVE_NPTH
 #endif
 #ifdef HAVE_NPTH
-#include <npth.h>
+# include <npth.h>
 #endif
 #ifdef HAVE_W32CE_SYSTEM
 # include <assuan.h> /* For _assuan_w32ce_finish_pipe. */
 #endif
 #ifdef HAVE_W32CE_SYSTEM
 # include <assuan.h> /* For _assuan_w32ce_finish_pipe. */
index 7193020..d78e5d2 100644 (file)
@@ -40,6 +40,9 @@
 #include <fcntl.h>
 #include <unistd.h>
 #ifdef HAVE_W32_SYSTEM
 #include <fcntl.h>
 #include <unistd.h>
 #ifdef HAVE_W32_SYSTEM
+# ifdef HAVE_WINSOCK2_H
+#  include <winsock2.h>
+# endif
 # include <windows.h>
 #endif
 #ifdef __riscos__
 # include <windows.h>
 #endif
 #ifdef __riscos__
index 2b5bb2d..bdc284f 100644 (file)
@@ -41,6 +41,9 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #ifdef HAVE_W32_SYSTEM
 #include <sys/types.h>
 #include <sys/stat.h>
 #ifdef HAVE_W32_SYSTEM
+# ifdef HAVE_WINSOCK2_H
+#  include <winsock2.h>
+# endif
 # include <windows.h>
 #else /*!HAVE_W32_SYSTEM*/
 # include <sys/socket.h>
 # include <windows.h>
 #else /*!HAVE_W32_SYSTEM*/
 # include <sys/socket.h>
index a8b1635..dd1f3a6 100644 (file)
@@ -81,6 +81,9 @@ time_t timegm (struct tm *tm);
 # include <sys/socket.h>
 # include <sys/un.h>
 #else
 # include <sys/socket.h>
 # include <sys/un.h>
 #else
+# ifdef HAVE_WINSOCK2_H
+#  include <winsock2.h>
+# endif
 # include <windows.h>
 #endif
 
 # include <windows.h>
 #endif
 
index 2b4b9ce..3c45e8b 100644 (file)
 #ifdef USE_DNS_PKA
 #include <sys/types.h>
 #ifdef _WIN32
 #ifdef USE_DNS_PKA
 #include <sys/types.h>
 #ifdef _WIN32
-#include <windows.h>
+# ifdef HAVE_WINSOCK2_H
+#  include <winsock2.h>
+# endif
+# include <windows.h>
 #else
 #include <netinet/in.h>
 #include <arpa/nameser.h>
 #else
 #include <netinet/in.h>
 #include <arpa/nameser.h>
index 74afbcb..380e356 100644 (file)
 #include <config.h>
 #include <sys/types.h>
 #ifdef _WIN32
 #include <config.h>
 #include <sys/types.h>
 #ifdef _WIN32
-#include <windows.h>
+# ifdef HAVE_WINSOCK2_H
+#  include <winsock2.h>
+# endif
+# include <windows.h>
 #else
 #include <netinet/in.h>
 #include <arpa/nameser.h>
 #else
 #include <netinet/in.h>
 #include <arpa/nameser.h>
index b7d487c..016d2b1 100644 (file)
@@ -32,6 +32,9 @@
 
 #ifdef USE_DNS_SRV
 # ifdef _WIN32
 
 #ifdef USE_DNS_SRV
 # ifdef _WIN32
+#  ifdef HAVE_WINSOCK2_H
+#   include <winsock2.h>
+#  endif
 #  include <windows.h>
 # else
 #  include <netinet/in.h>
 #  include <windows.h>
 # else
 #  include <netinet/in.h>
index d51d3e0..2d2b412 100644 (file)
@@ -41,6 +41,9 @@
 #include <unistd.h>
 #include <sys/types.h>
 #ifdef HAVE_W32_SYSTEM
 #include <unistd.h>
 #include <sys/types.h>
 #ifdef HAVE_W32_SYSTEM
+# ifdef HAVE_WINSOCK2_H
+#  include <winsock2.h>
+# endif
 # include <windows.h>
 #endif
 
 # include <windows.h>
 #endif
 
index f0c2ad8..0d92741 100644 (file)
@@ -57,6 +57,9 @@
 # if WINVER < 0x0500
 #   define WINVER 0x0500  /* Required for AllowSetForegroundWindow.  */
 # endif
 # if WINVER < 0x0500
 #   define WINVER 0x0500  /* Required for AllowSetForegroundWindow.  */
 # endif
+# ifdef HAVE_WINSOCK2_H
+#  include <winsock2.h>
+# endif
 # include <windows.h>
 #endif
 #ifdef HAVE_NPTH
 # include <windows.h>
 #endif
 #ifdef HAVE_NPTH
index a3f6327..66ca984 100644 (file)
@@ -53,6 +53,9 @@
 #endif
 #endif
 #ifdef USE_W32_CONSOLE
 #endif
 #endif
 #ifdef USE_W32_CONSOLE
+# ifdef HAVE_WINSOCK2_H
+#  include <winsock2.h>
+# endif
 # include <windows.h>
 # ifdef HAVE_TCGETATTR
 #  error mingw32 and termios
 # include <windows.h>
 # ifdef HAVE_TCGETATTR
 #  error mingw32 and termios
index 428705c..2507177 100644 (file)
@@ -36,6 +36,9 @@
 #include <stdlib.h>
 #include <string.h>
 #include <stdarg.h>
 #include <stdlib.h>
 #include <string.h>
 #include <stdarg.h>
+#ifdef HAVE_WINSOCK2_H
+# include <winsock2.h>
+#endif
 #include <windows.h>
 
 #include "libjnlib-config.h"
 #include <windows.h>
 
 #include "libjnlib-config.h"
index 8aa891f..0c13185 100644 (file)
@@ -25,6 +25,9 @@
 #include <string.h>
 #include <assert.h>
 #ifdef HAVE_W32_SYSTEM
 #include <string.h>
 #include <assert.h>
 #ifdef HAVE_W32_SYSTEM
+# ifdef HAVE_WINSOCK2_H
+#  include <winsock2.h>
+# endif
 # include <windows.h>
 #else /*!HAVE_W32_SYSTEM*/
 # include <sys/types.h>
 # include <windows.h>
 #else /*!HAVE_W32_SYSTEM*/
 # include <sys/types.h>
index 0caa43b..b0ff2ea 100644 (file)
 #include <sys/wait.h>
 #endif
 #ifdef HAVE_DOSISH_SYSTEM
 #include <sys/wait.h>
 #endif
 #ifdef HAVE_DOSISH_SYSTEM
-#include <windows.h>
+# ifdef HAVE_WINSOCK2_H
+#  include <winsock2.h>
+# endif
+# include <windows.h>
 #endif
 #include <fcntl.h>
 #include <unistd.h>
 #endif
 #include <fcntl.h>
 #include <unistd.h>
index 65a9cab..d24cc23 100644 (file)
--- a/g10/gpg.c
+++ b/g10/gpg.c
 #endif
 #include <fcntl.h>
 #ifdef HAVE_W32_SYSTEM
 #endif
 #include <fcntl.h>
 #ifdef HAVE_W32_SYSTEM
-#include <windows.h>
+# ifdef HAVE_WINSOCK2_H
+#  include <winsock2.h>
+# endif
+# include <windows.h>
 #endif
 
 #define INCLUDED_BY_MAIN_MODULE 1
 #endif
 
 #define INCLUDED_BY_MAIN_MODULE 1
index 9c28e5b..ba83b19 100644 (file)
@@ -41,6 +41,9 @@
 #ifdef HAVE_W32_SYSTEM
 #include <time.h>
 #include <process.h>
 #ifdef HAVE_W32_SYSTEM
 #include <time.h>
 #include <process.h>
+#ifdef HAVE_WINSOCK2_H
+# include <winsock2.h>
+#endif
 #include <windows.h>
 #include <shlobj.h>
 #ifndef CSIDL_APPDATA
 #include <windows.h>
 #include <shlobj.h>
 #ifndef CSIDL_APPDATA
index 132adca..829d36c 100644 (file)
@@ -22,6 +22,9 @@
 #include <stdio.h>
 #include <string.h>
 #ifdef _WIN32
 #include <stdio.h>
 #include <string.h>
 #ifdef _WIN32
+# ifdef HAVE_WINSOCK2_H
+#  include <winsock2.h>
+# endif
 # include <windows.h>
 # ifndef VER_PLATFORM_WIN32_WINDOWS
 #  define VER_PLATFORM_WIN32_WINDOWS 1
 # include <windows.h>
 # ifndef VER_PLATFORM_WIN32_WINDOWS
 #  define VER_PLATFORM_WIN32_WINDOWS 1