Skip to content

Commit e7e2056

Browse files
committed
Remove HAVE_PCRE/HAVE_BUNDLED_PCRE checks
PCRE is always available.
1 parent 5456a6e commit e7e2056

File tree

7 files changed

+2
-40
lines changed

7 files changed

+2
-40
lines changed

ext/mbstring/mbstring.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
# include "php_onig_compat.h"
6161
# include <oniguruma.h>
6262
# undef UChar
63-
#elif HAVE_PCRE || HAVE_BUNDLED_PCRE
63+
#else
6464
# include "ext/pcre/php_pcre.h"
6565
#endif
6666

@@ -1043,7 +1043,7 @@ static void _php_mb_free_regex(void *opaque)
10431043
onig_free((php_mb_regex_t *)opaque);
10441044
}
10451045
/* }}} */
1046-
#elif HAVE_PCRE || HAVE_BUNDLED_PCRE
1046+
#else
10471047
/* {{{ _php_mb_compile_regex */
10481048
static void *_php_mb_compile_regex(const char *pattern)
10491049
{

ext/pcre/php_pcre.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
#include "ext/standard/basic_functions.h"
2525
#include "zend_smart_str.h"
2626

27-
#if HAVE_PCRE || HAVE_BUNDLED_PCRE
28-
2927
#include "ext/standard/php_string.h"
3028

3129
#define PREG_PATTERN_ORDER 1
@@ -3079,5 +3077,3 @@ PHPAPI pcre2_code *php_pcre_pce_re(pcre_cache_entry *pce)
30793077
assert(NULL != pce);
30803078
return pce->re;
30813079
}/*}}}*/
3082-
3083-
#endif /* HAVE_PCRE || HAVE_BUNDLED_PCRE */

ext/pcre/php_pcre.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
#ifndef PHP_PCRE_H
2020
#define PHP_PCRE_H
2121

22-
#if HAVE_PCRE || HAVE_BUNDLED_PCRE
23-
2422
#if HAVE_BUNDLED_PCRE
2523
#include "pcre2lib/pcre2.h"
2624
#else
@@ -83,12 +81,6 @@ ZEND_END_MODULE_GLOBALS(pcre)
8381
PHPAPI ZEND_EXTERN_MODULE_GLOBALS(pcre)
8482
#define PCRE_G(v) ZEND_MODULE_GLOBALS_ACCESSOR(pcre, v)
8583

86-
#else
87-
88-
#define pcre_module_ptr NULL
89-
90-
#endif /* HAVE_PCRE || HAVE_BUNDLED_PCRE */
91-
9284
#define phpext_pcre_ptr pcre_module_ptr
9385

9486
#endif /* PHP_PCRE_H */

ext/spl/spl_iterators.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1521,7 +1521,6 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z
15211521
intern->u.append.iterator = spl_ce_ArrayIterator->get_iterator(spl_ce_ArrayIterator, &intern->u.append.zarrayit, 0);
15221522
zend_restore_error_handling(&error_handling);
15231523
return intern;
1524-
#if HAVE_PCRE || HAVE_BUNDLED_PCRE
15251524
case DIT_RegexIterator:
15261525
case DIT_RecursiveRegexIterator: {
15271526
zend_string *regex;
@@ -1551,7 +1550,6 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z
15511550
php_pcre_pce_incref(intern->u.regex.pce);
15521551
break;
15531552
}
1554-
#endif
15551553
case DIT_CallbackFilterIterator:
15561554
case DIT_RecursiveCallbackFilterIterator: {
15571555
_spl_cbfilter_it_intern *cfi = emalloc(sizeof(*cfi));
@@ -1953,7 +1951,6 @@ SPL_METHOD(ParentIterator, __construct)
19531951
spl_dual_it_construct(INTERNAL_FUNCTION_PARAM_PASSTHRU, spl_ce_ParentIterator, spl_ce_RecursiveIterator, DIT_ParentIterator);
19541952
} /* }}} */
19551953

1956-
#if HAVE_PCRE || HAVE_BUNDLED_PCRE
19571954
/* {{{ proto RegexIterator::__construct(Iterator it, string regex [, int mode [, int flags [, int preg_flags]]])
19581955
Create an RegexIterator from another iterator and a regular expression */
19591956
SPL_METHOD(RegexIterator, __construct)
@@ -2265,8 +2262,6 @@ SPL_METHOD(RecursiveRegexIterator, accept)
22652262
zend_call_method_with_0_params(ZEND_THIS, spl_ce_RegexIterator, NULL, "accept", return_value);
22662263
}
22672264

2268-
#endif
2269-
22702265
/* {{{ spl_dual_it_dtor */
22712266
static void spl_dual_it_dtor(zend_object *_object)
22722267
{
@@ -2304,7 +2299,6 @@ static void spl_dual_it_free_storage(zend_object *_object)
23042299
zval_ptr_dtor(&object->u.caching.zcache);
23052300
}
23062301

2307-
#if HAVE_PCRE || HAVE_BUNDLED_PCRE
23082302
if (object->dit_type == DIT_RegexIterator || object->dit_type == DIT_RecursiveRegexIterator) {
23092303
if (object->u.regex.pce) {
23102304
php_pcre_pce_decref(object->u.regex.pce);
@@ -2313,7 +2307,6 @@ static void spl_dual_it_free_storage(zend_object *_object)
23132307
zend_string_release_ex(object->u.regex.regex, 0);
23142308
}
23152309
}
2316-
#endif
23172310

23182311
if (object->dit_type == DIT_CallbackFilterIterator || object->dit_type == DIT_RecursiveCallbackFilterIterator) {
23192312
if (object->u.cbfilter) {
@@ -2403,7 +2396,6 @@ static const zend_function_entry spl_funcs_ParentIterator[] = {
24032396
PHP_FE_END
24042397
};
24052398

2406-
#if HAVE_PCRE || HAVE_BUNDLED_PCRE
24072399
ZEND_BEGIN_ARG_INFO_EX(arginfo_regex_it___construct, 0, 0, 2)
24082400
ZEND_ARG_OBJ_INFO(0, iterator, Iterator, 0)
24092401
ZEND_ARG_INFO(0, regex)
@@ -2452,7 +2444,6 @@ static const zend_function_entry spl_funcs_RecursiveRegexIterator[] = {
24522444
SPL_ME(RecursiveRegexIterator, getChildren, arginfo_recursive_it_void, ZEND_ACC_PUBLIC)
24532445
PHP_FE_END
24542446
};
2455-
#endif
24562447

24572448
static inline int spl_limit_it_valid(spl_dual_it_object *intern)
24582449
{
@@ -3741,7 +3732,6 @@ PHP_MINIT_FUNCTION(spl_iterators)
37413732
REGISTER_SPL_IMPLEMENTS(RecursiveIteratorIterator, OuterIterator);
37423733

37433734
REGISTER_SPL_SUB_CLASS_EX(InfiniteIterator, IteratorIterator, spl_dual_it_new, spl_funcs_InfiniteIterator);
3744-
#if HAVE_PCRE || HAVE_BUNDLED_PCRE
37453735
REGISTER_SPL_SUB_CLASS_EX(RegexIterator, FilterIterator, spl_dual_it_new, spl_funcs_RegexIterator);
37463736
REGISTER_SPL_CLASS_CONST_LONG(RegexIterator, "USE_KEY", REGIT_USE_KEY);
37473737
REGISTER_SPL_CLASS_CONST_LONG(RegexIterator, "INVERT_MATCH",REGIT_INVERTED);
@@ -3753,10 +3743,6 @@ PHP_MINIT_FUNCTION(spl_iterators)
37533743
REGISTER_SPL_PROPERTY(RegexIterator, "replacement", 0);
37543744
REGISTER_SPL_SUB_CLASS_EX(RecursiveRegexIterator, RegexIterator, spl_dual_it_new, spl_funcs_RecursiveRegexIterator);
37553745
REGISTER_SPL_IMPLEMENTS(RecursiveRegexIterator, RecursiveIterator);
3756-
#else
3757-
spl_ce_RegexIterator = NULL;
3758-
spl_ce_RecursiveRegexIterator = NULL;
3759-
#endif
37603746

37613747
REGISTER_SPL_STD_CLASS_EX(EmptyIterator, NULL, spl_funcs_EmptyIterator);
37623748
REGISTER_SPL_ITERATOR(EmptyIterator);

ext/spl/spl_iterators.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@
2121

2222
#include "php.h"
2323
#include "php_spl.h"
24-
#if HAVE_PCRE || HAVE_BUNDLED_PCRE
2524
#include "ext/pcre/php_pcre.h"
26-
#endif
2725

2826
#define spl_ce_Traversable zend_ce_traversable
2927
#define spl_ce_Iterator zend_ce_iterator
@@ -71,10 +69,8 @@ typedef enum {
7169
DIT_NoRewindIterator,
7270
DIT_InfiniteIterator,
7371
DIT_AppendIterator,
74-
#if HAVE_PCRE || HAVE_BUNDLED_PCRE
7572
DIT_RegexIterator,
7673
DIT_RecursiveRegexIterator,
77-
#endif
7874
DIT_CallbackFilterIterator,
7975
DIT_RecursiveCallbackFilterIterator,
8076
DIT_Unknown = ~0
@@ -150,7 +146,6 @@ typedef struct _spl_dual_it_object {
150146
zval zarrayit;
151147
zend_object_iterator *iterator;
152148
} append;
153-
#if HAVE_PCRE || HAVE_BUNDLED_PCRE
154149
struct {
155150
zend_long flags;
156151
zend_long preg_flags;
@@ -159,7 +154,6 @@ typedef struct _spl_dual_it_object {
159154
regex_mode mode;
160155
int use_flags;
161156
} regex;
162-
#endif
163157
_spl_cbfilter_it_intern *cbfilter;
164158
} u;
165159
zend_object std;

main/SAPI.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@
2727
#include "php_ini.h"
2828
#include "ext/standard/php_string.h"
2929
#include "ext/standard/pageinfo.h"
30-
#if (HAVE_PCRE || HAVE_BUNDLED_PCRE) && !defined(COMPILE_DL_PCRE)
3130
#include "ext/pcre/php_pcre.h"
32-
#endif
3331
#ifdef ZTS
3432
#include "TSRM.h"
3533
#endif

main/internal_functions_win32.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,7 @@
6262
#include "ext/iconv/php_iconv.h"
6363
#endif
6464
#include "ext/standard/reg.h"
65-
#if HAVE_PCRE || HAVE_BUNDLED_PCRE
6665
#include "ext/pcre/php_pcre.h"
67-
#endif
6866
#if HAVE_UODBC
6967
#include "ext/odbc/php_odbc.h"
7068
#endif
@@ -136,9 +134,7 @@ static zend_module_entry * const php_builtin_extensions[] = {
136134
#if HAVE_UODBC
137135
,phpext_odbc_ptr
138136
#endif
139-
#if HAVE_PCRE || HAVE_BUNDLED_PCRE
140137
,phpext_pcre_ptr
141-
#endif
142138
,phpext_reflection_ptr
143139
#if HAVE_PHP_SESSION
144140
,phpext_session_ptr

0 commit comments

Comments
 (0)