summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRemi Collet2021-01-04 19:32:08 +0100
committerGitHub2021-01-04 18:32:08 +0000
commit48f927e9694fcfd76d9fe97542359c8b0bd0a46d (patch)
tree9ad8fa51d77c3f5db0e0381d5fba10a4d550f7c2 /src
parent1e8e75b554955cc59866a41bb32853a96e8e83ae (diff)
Fix #368 build with system libpcre
Diffstat (limited to 'src')
-rw-r--r--src/sp_pcre_compat.c4
-rw-r--r--src/sp_pcre_compat.h3
2 files changed, 2 insertions, 5 deletions
diff --git a/src/sp_pcre_compat.c b/src/sp_pcre_compat.c
index b4d29f0..283eeb7 100644
--- a/src/sp_pcre_compat.c
+++ b/src/sp_pcre_compat.c
@@ -15,7 +15,7 @@ sp_pcre* sp_pcre_compile(const char* const pattern) {
15 const char* pcre_error = NULL; 15 const char* pcre_error = NULL;
16 int erroroffset; 16 int erroroffset;
17 ret = 17 ret =
18 php_pcre_compile(pattern, PCRE_CASELESS, &pcre_error, &erroroffset, NULL); 18 pcre_compile(pattern, PCRE_CASELESS, &pcre_error, &erroroffset, NULL);
19#endif 19#endif
20 20
21 if (NULL == ret) { 21 if (NULL == ret) {
@@ -38,7 +38,7 @@ bool ZEND_HOT sp_is_regexp_matching_len(const sp_pcre* regexp, const char* str,
38 ret = pcre2_match(regexp, (PCRE2_SPTR)str, len, 0, 0, match_data, NULL); 38 ret = pcre2_match(regexp, (PCRE2_SPTR)str, len, 0, 0, match_data, NULL);
39#else 39#else
40 int vec[30]; 40 int vec[30];
41 ret = php_pcre_exec(regexp, NULL, str, len, 0, 0, vec, 41 ret = pcre_exec(regexp, NULL, str, len, 0, 0, vec,
42 sizeof(vec) / sizeof(int)); 42 sizeof(vec) / sizeof(int));
43#endif 43#endif
44 44
diff --git a/src/sp_pcre_compat.h b/src/sp_pcre_compat.h
index 11f7f7c..14c33b2 100644
--- a/src/sp_pcre_compat.h
+++ b/src/sp_pcre_compat.h
@@ -4,9 +4,6 @@
4#include <stdlib.h> 4#include <stdlib.h>
5#include <stdbool.h> 5#include <stdbool.h>
6 6
7#undef pcre_exec
8#undef pcre_compile
9
10#define PCRE2_CODE_UNIT_WIDTH 8 7#define PCRE2_CODE_UNIT_WIDTH 8
11#if PHP_VERSION_ID >= 70300 8#if PHP_VERSION_ID >= 70300
12#define SP_HAS_PCRE2 9#define SP_HAS_PCRE2