aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cynapses.org>2010-12-29 20:36:14 +0100
committerAndreas Schneider <asn@cynapses.org>2010-12-29 20:36:14 +0100
commit296767afc466caa4a6b7e618e29ff74ec0c744c3 (patch)
tree12d6ae2c651b7f91e8be8d6b54f0343df9021a00
parent13f3679b2f81da19b3aad730eea5db864e432be5 (diff)
downloadlibssh-296767afc466caa4a6b7e618e29ff74ec0c744c3.tar.gz
libssh-296767afc466caa4a6b7e618e29ff74ec0c744c3.tar.xz
libssh-296767afc466caa4a6b7e618e29ff74ec0c744c3.zip
server: Added include files for getaddrinfo.
-rw-r--r--src/server.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/server.c b/src/server.c
index 330d5ef1..e4ecbe1e 100644
--- a/src/server.c
+++ b/src/server.c
@@ -28,8 +28,20 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#ifndef _WIN32
-#include <netinet/in.h>
+
+#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
+#else
+# include <netinet/in.h>
#endif
#include "libssh/priv.h"