blob: ee192e358169f05368ea3aa093e3d22c5484e6f9 [file] [log] [blame]
Andrew Geisslerc5535c92023-01-27 16:10:19 -06001From d2bf497b12fbd49b4996ccf0744303ffd67735b1 Mon Sep 17 00:00:00 2001
2From: Andrew Paprocki <andrew@ishiboo.com>
3Date: Wed, 21 Dec 2022 11:15:00 -0500
4Subject: [PATCH] PR29926: debuginfod: Fix usage of deprecated CURLINFO_*
5
6The `CURLINFO_SIZE_DOWNLOAD_T` and `CURLINFO_CONTENT_LENGTH_DOWNLOAD_T`
7identifiers are `enum`s, not pre-processor definitions, so the current
8`#ifdef` logic is not selecting the newer API. This results in the
9older identifiers being used and they now generate errors when compiled
10against Curl 7.87, which has silently deprecated them, causing GCC to
11emit `-Werror=deprecated-declarations`.
12
13Instead, the newer identifiers were added in Curl 7.55, so explicitly
14check for `CURL_AT_LEAST_VERSION(7, 55, 0)` instead of the current
15logic. This eliminates the error when compiling against Curl 7.87.
16
17Ref: https://github.com/curl/curl/pull/1511
18
19Upstream-Status: Backport [https://sourceware.org/git/?p=elfutils.git;a=commit;h=d2bf497b12fbd49b4996ccf0744303ffd67735b1]
20Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
21---
22 debuginfod/debuginfod-client.c | 4 ++--
23 2 files changed, 6 insertions(+), 2 deletions(-)
24
25diff --git a/debuginfod/debuginfod-client.c b/debuginfod/debuginfod-client.c
26index 8873fcc8..692aecce 100644
27--- a/debuginfod/debuginfod-client.c
28+++ b/debuginfod/debuginfod-client.c
29@@ -1456,7 +1456,7 @@ debuginfod_query_server (debuginfod_client *c,
30 deflate-compressing proxies, this number is likely to be
31 unavailable, so -1 may show. */
32 CURLcode curl_res;
33-#ifdef CURLINFO_CONTENT_LENGTH_DOWNLOAD_T
34+#if CURL_AT_LEAST_VERSION(7, 55, 0)
35 curl_off_t cl;
36 curl_res = curl_easy_getinfo(target_handle,
37 CURLINFO_CONTENT_LENGTH_DOWNLOAD_T,
38@@ -1491,7 +1491,7 @@ debuginfod_query_server (debuginfod_client *c,
39 if (target_handle) /* we've committed to a server; report its download progress */
40 {
41 CURLcode curl_res;
42-#ifdef CURLINFO_SIZE_DOWNLOAD_T
43+#if CURL_AT_LEAST_VERSION(7, 55, 0)
44 curl_off_t dl;
45 curl_res = curl_easy_getinfo(target_handle,
46 CURLINFO_SIZE_DOWNLOAD_T,
47--
482.39.1
49