From a944c6cc40273b45922fa22949fe6b12ff668889 Mon Sep 17 00:00:00 2001 From: Aki Koskinen Date: Mon, 2 Mar 2015 11:08:04 +0200 Subject: [PATCH 1/3] Don't include headers on windows that aren't available This mainly concerns mingw build. --- src/openssl_stream.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/openssl_stream.c b/src/openssl_stream.c index 2a17a3abf..e0cf9b6b3 100644 --- a/src/openssl_stream.c +++ b/src/openssl_stream.c @@ -12,9 +12,6 @@ #include #include -#include -#include -#include #include "global.h" #include "posix.h" @@ -23,6 +20,12 @@ #include "netops.h" #include "git2/transport.h" +#ifndef GIT_WIN32 +# include +# include +# include +#endif + static int ssl_set_error(SSL *ssl, int error) { int err; From ec0324422705875e84eb1afdeae36a4e1db5f467 Mon Sep 17 00:00:00 2001 From: Aki Koskinen Date: Fri, 27 Feb 2015 10:49:02 +0200 Subject: [PATCH 2/3] Include openssl headers last Windows headers #define some names that openssl uses too. Openssl headers #undef the offending names before reusing them. But if those offending Windows headers get included after the openssl headers the namespace is polluted and nothing good happens. Fixes issue #2850. --- src/openssl_stream.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/openssl_stream.c b/src/openssl_stream.c index e0cf9b6b3..9ddf6e4be 100644 --- a/src/openssl_stream.c +++ b/src/openssl_stream.c @@ -7,10 +7,6 @@ #ifdef GIT_SSL -#include -#include -#include - #include #include "global.h" @@ -26,6 +22,10 @@ # include #endif +#include +#include +#include + static int ssl_set_error(SSL *ssl, int error) { int err; From 45df2237bfe4bcb9df1c2f68b0d47ef0e4f3f78d Mon Sep 17 00:00:00 2001 From: Aki Koskinen Date: Fri, 27 Feb 2015 10:53:39 +0200 Subject: [PATCH 3/3] Include ws2tcpip.h in order to get in6_addr It's currently required in src/openssl_stream.c only. --- src/common.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/common.h b/src/common.h index 98109ae3a..cdfc13657 100644 --- a/src/common.h +++ b/src/common.h @@ -38,6 +38,7 @@ # include # include # include +# include # include "win32/msvc-compat.h" # include "win32/mingw-compat.h" # include "win32/error.h"