Andrew Geissler | c5535c9 | 2023-01-27 16:10:19 -0600 | [diff] [blame] | 1 | From d2bf497b12fbd49b4996ccf0744303ffd67735b1 Mon Sep 17 00:00:00 2001 |
| 2 | From: Andrew Paprocki <andrew@ishiboo.com> |
| 3 | Date: Wed, 21 Dec 2022 11:15:00 -0500 |
| 4 | Subject: [PATCH] PR29926: debuginfod: Fix usage of deprecated CURLINFO_* |
| 5 | |
| 6 | The `CURLINFO_SIZE_DOWNLOAD_T` and `CURLINFO_CONTENT_LENGTH_DOWNLOAD_T` |
| 7 | identifiers are `enum`s, not pre-processor definitions, so the current |
| 8 | `#ifdef` logic is not selecting the newer API. This results in the |
| 9 | older identifiers being used and they now generate errors when compiled |
| 10 | against Curl 7.87, which has silently deprecated them, causing GCC to |
| 11 | emit `-Werror=deprecated-declarations`. |
| 12 | |
| 13 | Instead, the newer identifiers were added in Curl 7.55, so explicitly |
| 14 | check for `CURL_AT_LEAST_VERSION(7, 55, 0)` instead of the current |
| 15 | logic. This eliminates the error when compiling against Curl 7.87. |
| 16 | |
| 17 | Ref: https://github.com/curl/curl/pull/1511 |
| 18 | |
| 19 | Upstream-Status: Backport [https://sourceware.org/git/?p=elfutils.git;a=commit;h=d2bf497b12fbd49b4996ccf0744303ffd67735b1] |
| 20 | Signed-off-by: Andrew Paprocki <andrew@ishiboo.com> |
| 21 | --- |
| 22 | debuginfod/debuginfod-client.c | 4 ++-- |
| 23 | 2 files changed, 6 insertions(+), 2 deletions(-) |
| 24 | |
| 25 | diff --git a/debuginfod/debuginfod-client.c b/debuginfod/debuginfod-client.c |
| 26 | index 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 | -- |
| 48 | 2.39.1 |
| 49 | |