Merge branch 'ma/help-w-check-for-requested-page'
[git.git] / git-curl-compat.h
bloba308bdb3b9b430398237b5ef6da29c9a20082ad8
1 #ifndef GIT_CURL_COMPAT_H
2 #define GIT_CURL_COMPAT_H
3 #include <curl/curl.h>
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.
11 * The oldest supported version of curl is documented in the "INSTALL"
12 * document.
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/).
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.
23 * We may also define a missing CURL_* symbol to its known value, if
24 * doing so is sufficient to add support for it to older versions that
25 * don't have it.
27 * Keep any symbols in date order of when their support was
28 * introduced, oldest first, in the official version of cURL library.
31 /**
32 * CURL_SOCKOPT_OK was added in 7.21.5, released in April 2011.
34 #if LIBCURL_VERSION_NUM < 0x071505
35 #define CURL_SOCKOPT_OK 0
36 #endif
38 /**
39 * CURLOPT_TCP_KEEPALIVE was added in 7.25.0, released in March 2012.
41 #if LIBCURL_VERSION_NUM >= 0x071900
42 #define GITCURL_HAVE_CURLOPT_TCP_KEEPALIVE 1
43 #endif
46 /**
47 * CURLOPT_LOGIN_OPTIONS was added in 7.34.0, released in December
48 * 2013.
50 * If we start requiring 7.34.0 we might also be able to remove the
51 * code conditional on USE_CURL_FOR_IMAP_SEND in imap-send.c, see
52 * 1e16b255b95 (git-imap-send: use libcurl for implementation,
53 * 2014-11-09) and the check it added for "072200" in the Makefile.
56 #if LIBCURL_VERSION_NUM >= 0x072200
57 #define GIT_CURL_HAVE_CURLOPT_LOGIN_OPTIONS 1
58 #endif
60 /**
61 * CURL_SSLVERSION_TLSv1_[012] was added in 7.34.0, released in
62 * December 2013.
64 #if LIBCURL_VERSION_NUM >= 0x072200
65 #define GIT_CURL_HAVE_CURL_SSLVERSION_TLSv1_0
66 #endif
68 /**
69 * CURLOPT_PINNEDPUBLICKEY was added in 7.39.0, released in November
70 * 2014.
72 #if LIBCURL_VERSION_NUM >= 0x072c00
73 #define GIT_CURL_HAVE_CURLOPT_PINNEDPUBLICKEY 1
74 #endif
76 /**
77 * CURL_HTTP_VERSION_2 was added in 7.43.0, released in June 2015.
79 * The CURL_HTTP_VERSION_2 alias (but not CURL_HTTP_VERSION_2_0) has
80 * always been a macro, not an enum field (checked on curl version
81 * 7.78.0)
83 #if LIBCURL_VERSION_NUM >= 0x072b00
84 #define GIT_CURL_HAVE_CURL_HTTP_VERSION_2 1
85 #endif
87 /**
88 * CURLSSLOPT_NO_REVOKE was added in 7.44.0, released in August 2015.
90 * The CURLSSLOPT_NO_REVOKE is, has always been a macro, not an enum
91 * field (checked on curl version 7.78.0)
93 #if LIBCURL_VERSION_NUM >= 0x072c00
94 #define GIT_CURL_HAVE_CURLSSLOPT_NO_REVOKE 1
95 #endif
97 /**
98 * CURLOPT_PROXY_CAINFO was added in 7.52.0, released in August 2017.
100 #if LIBCURL_VERSION_NUM >= 0x073400
101 #define GIT_CURL_HAVE_CURLOPT_PROXY_CAINFO 1
102 #endif
105 * CURLOPT_PROXY_{KEYPASSWD,SSLCERT,SSLKEY} was added in 7.52.0,
106 * released in August 2017.
108 #if LIBCURL_VERSION_NUM >= 0x073400
109 #define GIT_CURL_HAVE_CURLOPT_PROXY_KEYPASSWD 1
110 #endif
113 * CURL_SSLVERSION_TLSv1_3 was added in 7.53.0, released in February
114 * 2017.
116 #if LIBCURL_VERSION_NUM >= 0x073400
117 #define GIT_CURL_HAVE_CURL_SSLVERSION_TLSv1_3 1
118 #endif
121 * CURLSSLSET_{NO_BACKENDS,OK,TOO_LATE,UNKNOWN_BACKEND} were added in
122 * 7.56.0, released in September 2017.
124 #if LIBCURL_VERSION_NUM >= 0x073800
125 #define GIT_CURL_HAVE_CURLSSLSET_NO_BACKENDS
126 #endif
128 #endif