]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
PR29926: debuginfod: Fix usage of deprecated CURLINFO_*
authorAndrew Paprocki <andrew@ishiboo.com>
Wed, 21 Dec 2022 16:15:00 +0000 (11:15 -0500)
committerFrank Ch. Eigler <fche@redhat.com>
Wed, 21 Dec 2022 16:39:25 +0000 (11:39 -0500)
The `CURLINFO_SIZE_DOWNLOAD_T` and `CURLINFO_CONTENT_LENGTH_DOWNLOAD_T`
identifiers are `enum`s, not pre-processor definitions, so the current
`#ifdef` logic is not selecting the newer API.  This results in the
older identifiers being used and they now generate errors when compiled
against Curl 7.87, which has silently deprecated them, causing GCC to
emit `-Werror=deprecated-declarations`.

Instead, the newer identifiers were added in Curl 7.55, so explicitly
check for `CURL_AT_LEAST_VERSION(7, 55, 0)` instead of the current
logic.  This eliminates the error when compiling against Curl 7.87.

Ref: https://github.com/curl/curl/pull/1511

Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
debuginfod/ChangeLog
debuginfod/debuginfod-client.c

index a7afed94ebfdf40c0e0bcccf913189e33cd70c4c..2c65d8626e1561c23305eeafce38d96f11f12c44 100644 (file)
@@ -1,3 +1,7 @@
+2022-12-21  Andrew Paprocki  <andrew@ishiboo.com>
+
+       * debuginfod-client.c: Make compilable against newer curl.  PR29926
+
 2022-11-15  Mark Wielaard  <mark@klomp.org>
 
        * debuginfod-client.c (debuginfod_query_server): Initialize
index 8873fcc8c591225c5f0da3e4cc3805f315f46f9a..692aeccec08f382fd45e9a4af58d66daa61bf070 100644 (file)
@@ -1456,7 +1456,7 @@ debuginfod_query_server (debuginfod_client *c,
              deflate-compressing proxies, this number is likely to be
              unavailable, so -1 may show. */
           CURLcode curl_res;
-#ifdef CURLINFO_CONTENT_LENGTH_DOWNLOAD_T
+#if CURL_AT_LEAST_VERSION(7, 55, 0)
           curl_off_t cl;
           curl_res = curl_easy_getinfo(target_handle,
                                        CURLINFO_CONTENT_LENGTH_DOWNLOAD_T,
@@ -1491,7 +1491,7 @@ debuginfod_query_server (debuginfod_client *c,
           if (target_handle) /* we've committed to a server; report its download progress */
             {
               CURLcode curl_res;
-#ifdef CURLINFO_SIZE_DOWNLOAD_T
+#if CURL_AT_LEAST_VERSION(7, 55, 0)
               curl_off_t dl;
               curl_res = curl_easy_getinfo(target_handle,
                                            CURLINFO_SIZE_DOWNLOAD_T,