[master] f6d23b62c vre: turn autoconf check into cpp check

Nils Goroll nils.goroll at uplex.de
Sun May 18 15:03:04 UTC 2025


commit f6d23b62cc5368d0f33156e528e3b19937fae50a
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Sun May 18 12:50:13 2025 +0200

    vre: turn autoconf check into cpp check
    
    Good idea from vtest (phk, b3d75c2a0e3d54ee205e8c4a238239fc2de75fa5): We can do
    without autoconf here because pcre2_set_depth_limit is a macro
    
    Also, add a warning to prepare for turning missing pcre2_set_depth_limit into an
    error sooner or later.
    
    Found while working on reducing the delta to vtest

diff --git a/configure.ac b/configure.ac
index f457af5d5..a0701f4d3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -144,13 +144,6 @@ fi
 AC_SUBST(PCRE2_CFLAGS)
 AC_SUBST(PCRE2_LIBS)
 
-save_LIBS="${LIBS}"
-LIBS="${LIBS} ${PCRE2_LIBS}"
-AC_CHECK_FUNCS([pcre2_set_depth_limit_8], [
-  AC_DEFINE([HAVE_PCRE2_SET_DEPTH_LIMIT], [1], [Use pcre2_set_depth_limit()])
-])
-LIBS="${save_LIBS}"
-
 # --enable-pcre2-jit
 AC_ARG_ENABLE(pcre2-jit,
   AS_HELP_STRING([--enable-pcre2-jit],
diff --git a/lib/libvarnish/vre.c b/lib/libvarnish/vre.c
index c0f87c0c4..6d9b58bc1 100644
--- a/lib/libvarnish/vre.c
+++ b/lib/libvarnish/vre.c
@@ -43,7 +43,9 @@
 #include "vre.h"
 #include "vre_pcre2.h"
 
-#if !HAVE_PCRE2_SET_DEPTH_LIMIT
+/* should be turned into an error sooner or later */
+#if !defined(pcre2_set_depth_limit)
+#  warning pcre2 missing pcre2_set_depth_limit - update recommended
 #  define pcre2_set_depth_limit(r, d) pcre2_set_recursion_limit(r, d)
 #endif
 


More information about the varnish-commit mailing list