aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bind.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/bind.c b/src/bind.c
index d0dfa887..babefe4c 100644
--- a/src/bind.c
+++ b/src/bind.c
@@ -47,8 +47,17 @@
#ifdef _WIN32
-
#include <winsock2.h>
+#include <ws2tcpip.h>
+
+/*
+ * <wspiapi.h> is necessary for getaddrinfo before Windows XP, but it isn't
+ * available on some platforms like MinGW.
+ */
+#ifdef HAVE_WSPIAPI_H
+# include <wspiapi.h>
+#endif
+
#define SOCKOPT_TYPE_ARG4 char
/*