])
AS_IF([test "$have_pcre" != "no"], [
+ old_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $LIBPCRE_CFLAGS"
+ AC_CHECK_FUNCS([pcre2_substitute_callout_block])
+ CFLAGS="$old_CFLAGS"
AC_DEFINE(HAVE_LIBPCRE,, [Define if you have libpcre2 backed regular expressions])
])
return 0;
}
+#ifdef HAVE_PCRE2_SUBSTITUTE_CALLOUT_BLOCK
static int
dregex_code_substitute_callout(pcre2_substitute_callout_block *block ATTR_UNUSED, void *ctx)
{
return dregex_code_callout(NULL, ctx);
}
+#endif
static int dregex_code_guard(uint depth, void *ctx)
{
pcre2_set_compile_recursion_guard(code->cctx, dregex_code_guard, code);
/* these are used to ensure that CPU time isn't exceeded */
pcre2_set_callout(code->mctx, dregex_code_callout, code);
+#ifdef HAVE_PCRE2_SUBSTITUTE_CALLOUT_BLOCK
pcre2_set_substitute_callout(code->mctx, dregex_code_substitute_callout, code);
+#endif
/* Set some limits */
pcre2_set_match_limit(code->mctx, code->max_capture_groups);