aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac4
-rw-r--r--src/utils.c6
2 files changed, 9 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 1b1aa88df..4d274bfa2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -446,7 +446,11 @@ if test x$enable_ipv6 = xyes; then
AC_EGREP_CPP([AP_maGiC_VALUE],
[
#include <sys/types.h>
+#ifdef WIN32
+#include <winsock2.h>
+#else
#include <sys/socket.h>
+#endif
#include <netdb.h>
#ifdef PF_INET6
#ifdef AF_INET6
diff --git a/src/utils.c b/src/utils.c
index 53494cc5d..6e85dd5ff 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -33,7 +33,11 @@
#include <pwd.h>
#endif
-#ifdef HAVE_IPV6
+#if HAVE_IPV6 && WIN32
+#include <winsock2.h>
+#endif
+
+#if HAVE_IPV6 && ! WIN32
#include <sys/socket.h>
#endif