]> git.ipfire.org Git - thirdparty/git.git/blame - git-curl-compat.h
http: centralize the accounting of libcurl dependencies
[thirdparty/git.git] / git-curl-compat.h
CommitLineData
e4ff3b67
ÆAB
1#ifndef GIT_CURL_COMPAT_H
2#define GIT_CURL_COMPAT_H
3#include <curl/curl.h>
4
5/**
6 * This header centralizes the declaration of our libcurl dependencies
7 * to make it easy to discover the oldest versions we support, and to
8 * inform decisions about removing support for older libcurl in the
9 * future.
10 *
11 * The oldest supported version of curl is documented in the "INSTALL"
12 * document.
13 *
14 * The source of truth for what versions have which symbols is
15 * https://github.com/curl/curl/blob/master/docs/libcurl/symbols-in-versions;
16 * the release dates are taken from curl.git (at
17 * https://github.com/curl/curl/).
18 *
19 * For each X symbol we need from curl we define our own
20 * GIT_CURL_HAVE_X. If multiple similar symbols with the same prefix
21 * were defined in the same version we pick one and check for that name.
22 *
23 * Keep any symbols in date order of when their support was
24 * introduced, oldest first, in the official version of cURL library.
25 */
26
27/**
28 * CURLOPT_TCP_KEEPALIVE was added in 7.25.0, released in March 2012.
29 */
30#if LIBCURL_VERSION_NUM >= 0x071900
31#define GITCURL_HAVE_CURLOPT_TCP_KEEPALIVE 1
32#endif
33
34
35/**
36 * CURLOPT_LOGIN_OPTIONS was added in 7.34.0, released in December
37 * 2013.
38 *
39 * If we start requiring 7.34.0 we might also be able to remove the
40 * code conditional on USE_CURL_FOR_IMAP_SEND in imap-send.c, see
41 * 1e16b255b95 (git-imap-send: use libcurl for implementation,
42 * 2014-11-09) and the check it added for "072200" in the Makefile.
43
44 */
45#if LIBCURL_VERSION_NUM >= 0x072200
46#define GIT_CURL_HAVE_CURLOPT_LOGIN_OPTIONS 1
47#endif
48
49/**
50 * CURL_SSLVERSION_TLSv1_[012] was added in 7.34.0, released in
51 * December 2013.
52 */
53#if LIBCURL_VERSION_NUM >= 0x072200
54#define GIT_CURL_HAVE_CURL_SSLVERSION_TLSv1_0
55#endif
56
57/**
58 * CURLOPT_PINNEDPUBLICKEY was added in 7.39.0, released in November
59 * 2014.
60 */
61#if LIBCURL_VERSION_NUM >= 0x072c00
62#define GIT_CURL_HAVE_CURLOPT_PINNEDPUBLICKEY 1
63#endif
64
65/**
66 * CURL_HTTP_VERSION_2 was added in 7.43.0, released in June 2015.
67 *
68 * The CURL_HTTP_VERSION_2 alias (but not CURL_HTTP_VERSION_2_0) has
69 * always been a macro, not an enum field (checked on curl version
70 * 7.78.0)
71 */
72#if LIBCURL_VERSION_NUM >= 0x072b00
73#define GIT_CURL_HAVE_CURL_HTTP_VERSION_2 1
74#endif
75
76/**
77 * CURLSSLOPT_NO_REVOKE was added in 7.44.0, released in August 2015.
78 *
79 * The CURLSSLOPT_NO_REVOKE is, has always been a macro, not an enum
80 * field (checked on curl version 7.78.0)
81 */
82#if LIBCURL_VERSION_NUM >= 0x072c00
83#define GIT_CURL_HAVE_CURLSSLOPT_NO_REVOKE 1
84#endif
85
86/**
87 * CURLOPT_PROXY_CAINFO was added in 7.52.0, released in August 2017.
88 */
89#if LIBCURL_VERSION_NUM >= 0x073400
90#define GIT_CURL_HAVE_CURLOPT_PROXY_CAINFO 1
91#endif
92
93/**
94 * CURLOPT_PROXY_{KEYPASSWD,SSLCERT,SSLKEY} was added in 7.52.0,
95 * released in August 2017.
96 */
97#if LIBCURL_VERSION_NUM >= 0x073400
98#define GIT_CURL_HAVE_CURLOPT_PROXY_KEYPASSWD 1
99#endif
100
101/**
102 * CURL_SSLVERSION_TLSv1_3 was added in 7.53.0, released in February
103 * 2017.
104 */
105#if LIBCURL_VERSION_NUM >= 0x073400
106#define GIT_CURL_HAVE_CURL_SSLVERSION_TLSv1_3 1
107#endif
108
109/**
110 * CURLSSLSET_{NO_BACKENDS,OK,TOO_LATE,UNKNOWN_BACKEND} were added in
111 * 7.56.0, released in September 2017.
112 */
113#if LIBCURL_VERSION_NUM >= 0x073800
114#define GIT_CURL_HAVE_CURLSSLSET_NO_BACKENDS
115#endif
116
117#endif