]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
debuginfod: Define CURL_AT_LEAST_VERSION if necessary
authorMark Wielaard <mark@klomp.org>
Wed, 21 Dec 2022 17:21:08 +0000 (18:21 +0100)
committerMark Wielaard <mark@klomp.org>
Wed, 21 Dec 2022 17:21:18 +0000 (18:21 +0100)
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 <mark@klomp.org>
debuginfod/ChangeLog
debuginfod/debuginfod-client.c

index 2c65d8626e1561c23305eeafce38d96f11f12c44..2ddb7ca06f6e9555bf731a0d31387be186adb893 100644 (file)
@@ -1,3 +1,7 @@
+2022-12-21  Mark Wielaard  <mark@klomp.org>
+
+       * debuginfod-client.c: Define CURL_AT_LEAST_VERSION.
+
 2022-12-21  Andrew Paprocki  <andrew@ishiboo.com>
 
        * debuginfod-client.c: Make compilable against newer curl.  PR29926
index 692aeccec08f382fd45e9a4af58d66daa61bf070..a16165bd184d745e2379624476037e4edd2f168d 100644 (file)
@@ -105,6 +105,13 @@ void debuginfod_end (debuginfod_client *c) { }
   #include <fts.h>
 #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 <pthread.h>
 
 static pthread_once_t init_control = PTHREAD_ONCE_INIT;