Skip to content

Commit 3b832a0

Browse files
committed
openssl: include OpenSSL headers only when we're buliding against it
We need to include the initialisation and construction functions in all backend, so we include this header when building against SecureTransport and WinHTTP as well.
1 parent 2f3adf9 commit 3b832a0

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/openssl_stream.h

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77
#ifndef INCLUDE_openssl_stream_h__
88
#define INCLUDE_openssl_stream_h__
99

10-
#include <openssl/ssl.h>
11-
#include <openssl/err.h>
12-
#include <openssl/x509v3.h>
13-
#include <openssl/bio.h>
14-
1510
#include "git2/sys/stream.h"
1611

1712
extern int git_openssl_stream_global_init(void);
@@ -24,6 +19,14 @@ extern int git_openssl_stream_new(git_stream **out, const char *host, const char
2419
* we can program against the interface instead of littering the implementation
2520
* with ifdefs.
2621
*/
22+
#ifdef GIT_OPENSSL
23+
# include <openssl/ssl.h>
24+
# include <openssl/err.h>
25+
# include <openssl/x509v3.h>
26+
# include <openssl/bio.h>
27+
28+
29+
2730
# if OPENSSL_VERSION_NUMBER < 0x10100000L
2831

2932
GIT_INLINE(BIO_METHOD*) BIO_meth_new(int type, const char *name)
@@ -113,6 +116,7 @@ GIT_INLINE(const unsigned char *) ASN1_STRING_get0_data(const ASN1_STRING *x)
113116
return ASN1_STRING_data((ASN1_STRING *)x);
114117
}
115118

116-
# endif
119+
# endif // OpenSSL < 1.1
120+
#endif // GIT_OPENSSL
117121

118122
#endif

0 commit comments

Comments
 (0)