8000 openssl: only include necessary headers · libgit2/libgit2@1bc9781 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1bc9781

Browse files
committed
openssl: only include necessary headers
Avoid #include'ing the openssl_dynamic.h headers, which allows a user to exclude them from their source tree, in case they have odd license requirements.
1 parent 6ea625c commit 1bc9781

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

src/libgit2/streams/openssl.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
*/
77

88
#include "streams/openssl.h"
9-
#include "streams/openssl_legacy.h"
10-
#include "streams/openssl_dynamic.h"
119

1210
#ifdef GIT_OPENSSL
1311

src/libgit2/streams/openssl.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,14 @@
88
#define INCLUDE_streams_openssl_h__
99

1010
#include "common.h"
11-
#include "streams/openssl_legacy.h"
12-
#include "streams/openssl_dynamic.h"
11+
12+
#if defined(GIT_OPENSSL_LEGACY)
13+
# include "streams/openssl_legacy.h"
14+
#endif
15+
16+
#if defined(GIT_OPENSSL_DYNAMIC)
17+
# include "streams/openssl_dynamic.h"
18+
#endif
1319

1420
#include "git2/sys/stream.h"
1521

src/libgit2/streams/openssl_legacy.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
#ifndef INCLUDE_streams_openssl_legacy_h__
88
#define INCLUDE_streams_openssl_legacy_h__
99

10-
#include "streams/openssl_dynamic.h"
10+
#ifdef GIT_OPENSSL_DYNAMIC
11+
# include "streams/openssl_dynamic.h"
12+
#endif
1113

1214
#if defined(GIT_OPENSSL) && !defined(GIT_OPENSSL_DYNAMIC)
1315
# include <openssl/ssl.h>

0 commit comments

Comments
 (0)
0