summaryrefslogtreecommitdiff
path: root/src/sp_pcre_compat.h
diff options
context:
space:
mode:
authorjvoisin2018-07-13 23:36:06 +0200
committerjvoisin2018-07-13 23:36:06 +0200
commit02afd6c84f5e4f11b1de054f36d7d1da87206def (patch)
tree934b8669e520382ce9776c61197c1391cddeca35 /src/sp_pcre_compat.h
parent99f9ecae9a5edf5d36f5de62ccf60f9d9146057a (diff)
Yet an other pass of clang-format
Diffstat (limited to 'src/sp_pcre_compat.h')
-rw-r--r--src/sp_pcre_compat.h27
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
29sp_pcre* sp_pcre_compile(const char* str); 29sp_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))
34bool sp_is_regexp_matching_len(const sp_pcre* regexp, const char* str, size_t len); 34bool 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