[master] 3c399b858 Move PCRE2_CODE_UNIT_WIDTH to vre_pcre2.h

Nils Goroll nils.goroll at uplex.de
Tue Aug 3 12:34:06 UTC 2021


commit 3c399b8585bd1abe26922792c33ec2fe836dad72
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Mon Aug 2 17:59:30 2021 +0200

    Move PCRE2_CODE_UNIT_WIDTH to vre_pcre2.h
    
    We need to ensure that vmods use the same functions and data
    types as varnish-cache.
    
    Also it seems that having the define in autoconf might suggest
    that it could be changed, which would be misleading.

diff --git a/configure.ac b/configure.ac
index 2b96413d6..c396a3806 100644
--- a/configure.ac
+++ b/configure.ac
@@ -138,7 +138,6 @@ else
 fi
 AC_SUBST(PCRE2_CFLAGS)
 AC_SUBST(PCRE2_LIBS)
-AC_DEFINE([PCRE2_CODE_UNIT_WIDTH], [8], [Work with 8-bit characters for PCRE2])
 
 save_LIBS="${LIBS}"
 LIBS="${LIBS} ${PCRE2_LIBS}"
diff --git a/include/vre_pcre2.h b/include/vre_pcre2.h
index f020875f8..d8af96e8d 100644
--- a/include/vre_pcre2.h
+++ b/include/vre_pcre2.h
@@ -38,6 +38,8 @@
 #ifndef VRE_PCRE2_H_INCLUDED
 #define VRE_PCRE2_H_INCLUDED
 
+#define PCRE2_CODE_UNIT_WIDTH 8
+
 #include <pcre2.h>
 
 pcre2_code *VRE_unpack(const vre_t *code);


More information about the varnish-commit mailing list