diff options
Diffstat (limited to 'src/sp_pcre_compat.h')
| -rw-r--r-- | src/sp_pcre_compat.h | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/sp_pcre_compat.h b/src/sp_pcre_compat.h index 6658316..093a9c3 100644 --- a/src/sp_pcre_compat.h +++ b/src/sp_pcre_compat.h | |||
| @@ -10,27 +10,28 @@ | |||
| 10 | /* We're not supporting pcre2 when it's not bundled with php7, | 10 | /* We're not supporting pcre2 when it's not bundled with php7, |
| 11 | * yet. Pull-requests are welcome. */ | 11 | * yet. Pull-requests are welcome. */ |
| 12 | #if HAVE_BUNDLED_PCRE | 12 | #if HAVE_BUNDLED_PCRE |
| 13 | #if PHP_VERSION_ID >= 70300 | 13 | #if PHP_VERSION_ID >= 70300 |
| 14 | #define SP_HAS_PCRE2 | 14 | #define SP_HAS_PCRE2 |
| 15 | #include "ext/pcre/pcre2lib/pcre2.h" | 15 | #include "ext/pcre/pcre2lib/pcre2.h" |
| 16 | #else | ||
| 17 | #include "ext/pcre/pcrelib/pcre.h" | ||
| 18 | #endif | ||
| 19 | #else | 16 | #else |
| 20 | #include "pcre.h" | 17 | #include "ext/pcre/pcrelib/pcre.h" |
| 18 | #endif | ||
| 19 | #else | ||
| 20 | #include "pcre.h" | ||
| 21 | #endif | 21 | #endif |
| 22 | 22 | ||
| 23 | #ifdef SP_HAS_PCRE2 | 23 | #ifdef SP_HAS_PCRE2 |
| 24 | #define sp_pcre pcre2_code | 24 | #define sp_pcre pcre2_code |
| 25 | #else | 25 | #else |
| 26 | #define sp_pcre pcre | 26 | #define sp_pcre pcre |
| 27 | #endif | 27 | #endif |
| 28 | 28 | ||
| 29 | sp_pcre* sp_pcre_compile(const char* str); | 29 | sp_pcre* sp_pcre_compile(const char* str); |
| 30 | #define sp_is_regexp_matching_zend(regexp, zstr) \ | 30 | #define sp_is_regexp_matching_zend(regexp, zstr) \ |
| 31 | sp_is_regexp_matching_len(regexp, ZSTR_VAL(zstr), ZSTR_LEN(zstr)) | 31 | sp_is_regexp_matching_len(regexp, ZSTR_VAL(zstr), ZSTR_LEN(zstr)) |
| 32 | #define sp_is_regexp_matching(regexp, str) \ | 32 | #define sp_is_regexp_matching(regexp, str) \ |
| 33 | sp_is_regexp_matching_len(regexp, str, strlen(str)) | 33 | sp_is_regexp_matching_len(regexp, str, strlen(str)) |
| 34 | bool sp_is_regexp_matching_len(const sp_pcre* regexp, const char* str, size_t len); | 34 | bool sp_is_regexp_matching_len(const sp_pcre* regexp, const char* str, |
| 35 | size_t len); | ||
| 35 | 36 | ||
| 36 | #endif // SP_PCRE_COMPAT_H | 37 | #endif // SP_PCRE_COMPAT_H |
