Commit 20273e4d3cf2554fb6d209474400105ca15e92b5

Edward Thomson 2015-03-03T10:08:51

Merge pull request #2934 from akikoskinen/mingw_build_fix Fix build on mingw (master branch)

diff --git a/src/common.h b/src/common.h
index 98109ae..cdfc136 100644
--- a/src/common.h
+++ b/src/common.h
@@ -38,6 +38,7 @@
 # include <direct.h>
 # include <winsock2.h>
 # include <windows.h>
+# include <ws2tcpip.h>
 # include "win32/msvc-compat.h"
 # include "win32/mingw-compat.h"
 # include "win32/error.h"
diff --git a/src/openssl_stream.c b/src/openssl_stream.c
index 2a17a3a..9ddf6e4 100644
--- a/src/openssl_stream.c
+++ b/src/openssl_stream.c
@@ -7,14 +7,7 @@
 
 #ifdef GIT_SSL
 
-#include <openssl/ssl.h>
-#include <openssl/err.h>
-#include <openssl/x509v3.h>
-
 #include <ctype.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
 
 #include "global.h"
 #include "posix.h"
@@ -23,6 +16,16 @@
 #include "netops.h"
 #include "git2/transport.h"
 
+#ifndef GIT_WIN32
+# include <sys/types.h>
+# include <sys/socket.h>
+# include <netinet/in.h>
+#endif
+
+#include <openssl/ssl.h>
+#include <openssl/err.h>
+#include <openssl/x509v3.h>
+
 static int ssl_set_error(SSL *ssl, int error)
 {
 	int err;