]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
version: allow building with ancient libpsl
authorPeter Krefting <peter@softwolves.pp.se>
Fri, 2 Feb 2024 22:22:32 +0000 (23:22 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 6 Feb 2024 08:50:35 +0000 (09:50 +0100)
The psl_check_version_number() API was added in libpsl 0.11.0. CentOS 7
ships with version 0.7.0 which lacks this API. Revert to using the older
versioning API if we detect an old libpsl version.

Follow-up to 72bd88adde0e8cf6e63644a7d6df1da01a399db4
Bug: https://curl.se/mail/archive-2024-02/0004.html
Reported-by: Scott Mutter
Closes #12872

lib/version.c

index 01c2a315e5c2084805420d9e40c36caa08ee48e6..88f3696dec74cb3b200e7c1cfdddac20286ac984 100644 (file)
@@ -212,9 +212,15 @@ char *curl_version(void)
 
 #ifdef USE_LIBPSL
   {
+#if defined(PSL_VERSION_MAJOR) && (PSL_VERSION_MAJOR > 0 ||     \
+                                   PSL_VERSION_MINOR >= 11)
     int num = psl_check_version_number(0);
     msnprintf(psl_version, sizeof(psl_version), "libpsl/%d.%d.%d",
               num >> 16, (num >> 8) & 0xff, num & 0xff);
+#else
+    msnprintf(psl_version, sizeof(psl_version), "libpsl/%s",
+              psl_get_version());
+#endif
     src[i++] = psl_version;
   }
 #endif