summaryrefslogtreecommitdiffstats
path: root/369.patch
blob: ddcd5110b0aa169e30200d9de7fa8da16c24fb3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
From da4452a8084115f5975c88efab3671cdc2a07cf8 Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@remirepo.net>
Date: Mon, 4 Jan 2021 12:34:26 +0100
Subject: [PATCH] Fix #368 build with system libpcre

---
 src/sp_pcre_compat.c | 4 ++--
 src/sp_pcre_compat.h | 3 ---
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/sp_pcre_compat.c b/src/sp_pcre_compat.c
index b4d29f06..283eeb7f 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) {
   const char* pcre_error = NULL;
   int erroroffset;
   ret =
-      php_pcre_compile(pattern, PCRE_CASELESS, &pcre_error, &erroroffset, NULL);
+      pcre_compile(pattern, PCRE_CASELESS, &pcre_error, &erroroffset, NULL);
 #endif
 
   if (NULL == ret) {
@@ -38,7 +38,7 @@ bool ZEND_HOT sp_is_regexp_matching_len(const sp_pcre* regexp, const char* str,
   ret = pcre2_match(regexp, (PCRE2_SPTR)str, len, 0, 0, match_data, NULL);
 #else
   int vec[30];
-  ret = php_pcre_exec(regexp, NULL, str, len, 0, 0, vec,
+  ret = pcre_exec(regexp, NULL, str, len, 0, 0, vec,
                       sizeof(vec) / sizeof(int));
 #endif
 
diff --git a/src/sp_pcre_compat.h b/src/sp_pcre_compat.h
index 11f7f7ca..14c33b2d 100644
--- a/src/sp_pcre_compat.h
+++ b/src/sp_pcre_compat.h
@@ -4,9 +4,6 @@
 #include <stdlib.h>
 #include <stdbool.h>
 
-#undef pcre_exec
-#undef pcre_compile
-
 #define PCRE2_CODE_UNIT_WIDTH 8
 #if PHP_VERSION_ID >= 70300
 #define SP_HAS_PCRE2