|
10 | 10 | #include "cpr/util.h"
|
11 | 11 | #include <utility>
|
12 | 12 |
|
13 |
| -#define __LIBCURL_VERSION_GTE(major, minor) ((LIBCURL_VERSION_MAJOR > (major)) || ((LIBCURL_VERSION_MAJOR == (major)) && (LIBCURL_VERSION_MINOR >= (minor)))) |
14 |
| -#define __LIBCURL_VERSION_LT(major, minor) ((LIBCURL_VERSION_MAJOR < (major)) || ((LIBCURL_VERSION_MAJOR == (major)) && (LIBCURL_VERSION_MINOR < (minor)))) |
15 |
| - |
16 | 13 | #ifndef SUPPORT_ALPN
|
17 |
| -#define SUPPORT_ALPN __LIBCURL_VERSION_GTE(7, 36) |
| 14 | +#define SUPPORT_ALPN LIBCURL_VERSION_NUM >= 0x072400 // 7.36.0 |
18 | 15 | #endif
|
19 | 16 | #ifndef SUPPORT_NPN
|
20 |
| -#define SUPPORT_NPN __LIBCURL_VERSION_GTE(7, 36) && __LIBCURL_VERSION_LT(7, 86) |
| 17 | +#define SUPPORT_NPN LIBCURL_VERSION_NUM >= 0x072400 && LIBCURL_VERSION_NUM <= 0x078600 // 7.36.0 - 7.86.0 |
21 | 18 | #endif
|
22 | 19 |
|
23 | 20 | #ifndef SUPPORT_SSLv2
|
24 |
| -#define SUPPORT_SSLv2 __LIBCURL_VERSION_LT(7, 19) |
| 21 | +#define SUPPORT_SSLv2 LIBCURL_VERSION_NUM <= 0x071300 // 7.19.0 |
25 | 22 | #endif
|
26 | 23 | #ifndef SUPPORT_SSLv3
|
27 |
| -#define SUPPORT_SSLv3 __LIBCURL_VERSION_LT(7, 39) |
| 24 | +#define SUPPORT_SSLv3 LIBCURL_VERSION_NUM <= 0x072700 // 7.39.0 |
28 | 25 | #endif
|
29 | 26 | #ifndef SUPPORT_TLSv1_0
|
30 |
| -#define SUPPORT_TLSv1_0 __LIBCURL_VERSION_GTE(7, 34) |
| 27 | +#define SUPPORT_TLSv1_0 LIBCURL_VERSION_NUM >= 0x072200 // 7.34.0 |
31 | 28 | #endif
|
32 | 29 | #ifndef SUPPORT_TLSv1_1
|
33 |
| -#define SUPPORT_TLSv1_1 __LIBCURL_VERSION_GTE(7, 34) |
| 30 | +#define SUPPORT_TLSv1_1 LIBCURL_VERSION_NUM >= 0x072200 // 7.34.0 |
34 | 31 | #endif
|
35 | 32 | #ifndef SUPPORT_TLSv1_2
|
36 |
| -#define SUPPORT_TLSv1_2 __LIBCURL_VERSION_GTE(7, 34) |
| 33 | +#define SUPPORT_TLSv1_2 LIBCURL_VERSION_NUM >= 0x072200 // 7.34.0 |
37 | 34 | #endif
|
38 | 35 | #ifndef SUPPORT_TLSv1_3
|
39 |
| -#define SUPPORT_TLSv1_3 __LIBCURL_VERSION_GTE(7, 52) |
| 36 | +#define SUPPORT_TLSv1_3 LIBCURL_VERSION_NUM >= 0x073400 // 7.52.0 |
40 | 37 | #endif
|
41 | 38 | #ifndef SUPPORT_MAX_TLS_VERSION
|
42 |
| -#define SUPPORT_MAX_TLS_VERSION __LIBCURL_VERSION_GTE(7, 54) |
| 39 | +#define SUPPORT_MAX_TLS_VERSION LIBCURL_VERSION_NUM >= 0x073600 // 7.54.0 |
43 | 40 | #endif
|
44 | 41 | #ifndef SUPPORT_MAX_TLSv1_1
|
45 |
| -#define SUPPORT_MAX_TLSv1_1 __LIBCURL_VERSION_GTE(7, 54) |
| 42 | +#define SUPPORT_MAX_TLSv1_1 LIBCURL_VERSION_NUM >= 0x073600 // 7.54.0 |
46 | 43 | #endif
|
47 | 44 | #ifndef SUPPORT_MAX_TLSv1_2
|
48 |
| -#define SUPPORT_MAX_TLSv1_2 __LIBCURL_VERSION_GTE(7, 54) |
| 45 | +#define SUPPORT_MAX_TLSv1_2 LIBCURL_VERSION_NUM >= 0x073600 // 7.54.0 |
49 | 46 | #endif
|
50 | 47 | #ifndef SUPPORT_MAX_TLSv1_3
|
51 |
| -#define SUPPORT_MAX_TLSv1_3 __LIBCURL_VERSION_GTE(7, 54) |
| 48 | +#define SUPPORT_MAX_TLSv1_3 LIBCURL_VERSION_NUM >= 0x073600 // 7.54.0 |
52 | 49 | #endif
|
53 | 50 | #ifndef SUPPORT_TLSv13_CIPHERS
|
54 |
| -#define SUPPORT_TLSv13_CIPHERS __LIBCURL_VERSION_GTE(7, 61) |
| 51 | +#define SUPPORT_TLSv13_CIPHERS LIBCURL_VERSION_NUM >= 0x073D00 // 7.61.0 |
55 | 52 | #endif
|
56 | 53 | #ifndef SUPPORT_SESSIONID_CACHE
|
57 |
| -#define SUPPORT_SESSIONID_CACHE __LIBCURL_VERSION_GTE(7, 16) |
| 54 | +#define SUPPORT_SESSIONID_CACHE LIBCURL_VERSION_NUM >= 0x071000 // 7.16.0 |
58 | 55 | #endif
|
59 | 56 | #ifndef SUPPORT_SSL_FALSESTART
|
60 |
| -#define SUPPORT_SSL_FALSESTART __LIBCURL_VERSION_GTE(7, 42) |
| 57 | +#define SUPPORT_SSL_FALSESTART LIBCURL_VERSION_NUM >= 0x072A00 // 7.42.0 |
61 | 58 | #endif
|
62 | 59 | #ifndef SUPPORT_SSL_NO_REVOKE
|
63 |
| -#define SUPPORT_SSL_NO_REVOKE __LIBCURL_VERSION_GTE(7, 44) |
| 60 | +#define SUPPORT_SSL_NO_REVOKE LIBCURL_VERSION_NUM >= 0x072C00 // 7.44.0 |
64 | 61 | #endif
|
65 | 62 | #ifndef SUPPORT_CURLOPT_SSLKEY_BLOB
|
66 |
| -#define SUPPORT_CURLOPT_SSLKEY_BLOB __LIBCURL_VERSION_GTE(7, 71) |
| 63 | +#define SUPPORT_CURLOPT_SSLKEY_BLOB LIBCURL_VERSION_NUM >= 0x074700 // 7.71.0 |
67 | 64 | #endif
|
68 | 65 | #ifndef SUPPORT_CURLOPT_SSL_CTX_FUNCTION
|
69 |
| -#define SUPPORT_CURLOPT_SSL_CTX_FUNCTION __LIBCURL_VERSION_GTE(7, 11) |
| 66 | +#define SUPPORT_CURLOPT_SSL_CTX_FUNCTION LIBCURL_VERSION_NUM >= 0x070B00 // 7.11.0 |
70 | 67 | #endif
|
71 | 68 |
|
72 | 69 | namespace cpr {
|
@@ -108,7 +105,7 @@ class DerCert : public CertFile {
|
108 | 105 | // NOLINTNEXTLINE(google-explicit-constructor, hicpp-explicit-conversions)
|
109 | 106 | DerCert(std::string&& p_filename) : CertFile(std::move(p_filename)) {}
|
110 | 107 |
|
111 |
| - virtual ~DerCert() = default; |
| 108 | + ~DerCert() override = default; |
112 | 109 |
|
113 | 110 | const char* GetCertType() const override {
|
114 | 111 | return "DER";
|
@@ -168,7 +165,7 @@ class DerKey : public KeyFile {
|
168 | 165 | template <typename FileType, typename PassType>
|
169 | 166 | DerKey(FileType&& p_filename, PassType p_password) : KeyFile(std::forward<FileType>(p_filename), std::move(p_password)) {}
|
170 | 167 |
|
171 |
| - virtual ~DerKey() = default; |
| 168 | + ~DerKey() override = default; |
172 | 169 |
|
173 | 170 | const char* GetKeyType() const override {
|
174 | 171 | return "DER";
|
|
0 commit comments