aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/dns-cert.c3
-rw-r--r--common/estream.c3
-rw-r--r--common/http.c3
-rw-r--r--common/init.c7
-rw-r--r--common/iobuf.c3
-rw-r--r--common/logging.c3
-rw-r--r--common/mischelp.h3
-rw-r--r--common/pka.c5
-rw-r--r--common/srv.c5
-rw-r--r--common/srv.h3
-rw-r--r--common/stringhelp.c3
-rw-r--r--common/sysutils.c3
-rw-r--r--common/ttyio.c3
-rw-r--r--common/w32-reg.c3
14 files changed, 46 insertions, 4 deletions
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 <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>
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 <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
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 <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>
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 <windows.h>
+# ifdef HAVE_WINSOCK2_H
+# include <winsock2.h>
+# endif
+# include <windows.h>
#endif
#ifdef HAVE_NPTH
-#include <npth.h>
+# include <npth.h>
#endif
#ifdef HAVE_W32CE_SYSTEM
# include <assuan.h> /* 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 <fcntl.h>
#include <unistd.h>
#ifdef HAVE_W32_SYSTEM
+# ifdef HAVE_WINSOCK2_H
+# include <winsock2.h>
+# endif
# include <windows.h>
#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 <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>
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 <sys/socket.h>
# include <sys/un.h>
#else
+# ifdef HAVE_WINSOCK2_H
+# include <winsock2.h>
+# endif
# include <windows.h>
#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 <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>
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 <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>
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 <winsock2.h>
+# endif
# include <windows.h>
# else
# include <netinet/in.h>
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 <unistd.h>
#include <sys/types.h>
#ifdef HAVE_W32_SYSTEM
+# ifdef HAVE_WINSOCK2_H
+# include <winsock2.h>
+# endif
# include <windows.h>
#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 <winsock2.h>
+# endif
# include <windows.h>
#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 <winsock2.h>
+# endif
# include <windows.h>
# 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 <stdlib.h>
#include <string.h>
#include <stdarg.h>
+#ifdef HAVE_WINSOCK2_H
+# include <winsock2.h>
+#endif
#include <windows.h>
#include "libjnlib-config.h"