From 98ed3be52fa15521ef405fc8029176279d80778e Mon Sep 17 00:00:00 2001 From: Julien Voisin Date: Thu, 24 Dec 2020 10:32:28 +0000 Subject: Add PHP8 support --- src/sp_pcre_compat.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/sp_pcre_compat.h') diff --git a/src/sp_pcre_compat.h b/src/sp_pcre_compat.h index 6fcb383..b70630d 100644 --- a/src/sp_pcre_compat.h +++ b/src/sp_pcre_compat.h @@ -7,18 +7,18 @@ #undef pcre_exec #undef pcre_compile -#if HAVE_BUNDLED_PCRE -#if PHP_VERSION_ID >= 70300 -#include "ext/pcre/php_pcre.h" -#else -#include "ext/pcre/pcrelib/pcre.h" -#endif -#else + #define PCRE2_CODE_UNIT_WIDTH 8 -#include "pcre2.h" +#if PHP_VERSION_ID >= 70300 +#define SP_HAS_PCRE2 #endif +#include "ext/pcre/php_pcre.h" // PCRE1 +#ifdef SP_HAS_PCRE2 #define sp_pcre pcre2_code +#else +#define sp_pcre pcre +#endif sp_pcre* sp_pcre_compile(const char* str); #define sp_is_regexp_matching_zend(regexp, zstr) \ -- cgit v1.3