From: Mark Wielaard Date: Wed, 21 Dec 2022 17:21:08 +0000 (+0100) Subject: debuginfod: Define CURL_AT_LEAST_VERSION if necessary X-Git-Tag: elfutils-0.189~49 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=304741e11018c29e7ff17751e05dcc5c786a3fd9;p=thirdparty%2Felfutils.git debuginfod: Define CURL_AT_LEAST_VERSION if necessary Older curl.h don't define CURL_AT_LEAST_VERSION, so define it ourselves because it is nicer than doing hex encoded version comparisons. Signed-off-by: Mark Wielaard --- diff --git a/debuginfod/ChangeLog b/debuginfod/ChangeLog index 2c65d8626..2ddb7ca06 100644 --- a/debuginfod/ChangeLog +++ b/debuginfod/ChangeLog @@ -1,3 +1,7 @@ +2022-12-21 Mark Wielaard + + * debuginfod-client.c: Define CURL_AT_LEAST_VERSION. + 2022-12-21 Andrew Paprocki * debuginfod-client.c: Make compilable against newer curl. PR29926 diff --git a/debuginfod/debuginfod-client.c b/debuginfod/debuginfod-client.c index 692aeccec..a16165bd1 100644 --- a/debuginfod/debuginfod-client.c +++ b/debuginfod/debuginfod-client.c @@ -105,6 +105,13 @@ void debuginfod_end (debuginfod_client *c) { } #include #endif +/* Older curl.h don't define CURL_AT_LEAST_VERSION. */ +#ifndef CURL_AT_LEAST_VERSION + #define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|(z)) + #define CURL_AT_LEAST_VERSION(x,y,z) \ + (LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z)) +#endif + #include static pthread_once_t init_control = PTHREAD_ONCE_INIT;