Git fork
at reftables-rust 62 lines 1.9 kB view raw
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 * 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. 26 * 27 * Keep any symbols in date order of when their support was 28 * introduced, oldest first, in the official version of cURL library. 29 */ 30 31/** 32 * Versions before curl 7.66.0 (September 2019) required manually setting the 33 * transfer-encoding for a streaming POST; after that this is handled 34 * automatically. 35 */ 36#if LIBCURL_VERSION_NUM < 0x074200 37#define GIT_CURL_NEED_TRANSFER_ENCODING_HEADER 38#endif 39 40/** 41 * CURLOPT_PROTOCOLS_STR and CURLOPT_REDIR_PROTOCOLS_STR were added in 7.85.0, 42 * released in August 2022. 43 */ 44#if LIBCURL_VERSION_NUM >= 0x075500 45#define GIT_CURL_HAVE_CURLOPT_PROTOCOLS_STR 1 46#endif 47 48/** 49 * curl_global_trace() was added in 8.3.0, released September 2023. 50 */ 51#if LIBCURL_VERSION_NUM >= 0x080300 52#define GIT_CURL_HAVE_GLOBAL_TRACE 1 53#endif 54 55/** 56 * CURLOPT_TCP_KEEPCNT was added in 8.9.0, released in July, 2024. 57 */ 58#if LIBCURL_VERSION_NUM >= 0x080900 59#define GIT_CURL_HAVE_CURLOPT_TCP_KEEPCNT 60#endif 61 62#endif