Fix compilation on MacOS

memrchr has an always available equivalent under the name of zend_memrchr.

Signed-off-by: Bob Weinand <bobwei9@hotmail.com>
This commit is contained in:
Bob Weinand 2022-08-24 18:38:27 +02:00
parent 9e6eab3c13
commit 800c6672e5
4 changed files with 7 additions and 11 deletions

View file

@ -177,11 +177,7 @@ static zend_object *spl_array_object_new_ex(zend_class_entry *class_type, zend_o
}
while (parent) {
if (parent == spl_ce_ArrayIterator || parent == spl_ce_RecursiveArrayIterator) {
intern->std.handlers = &spl_handler_ArrayIterator;
break;
} else if (parent == spl_ce_ArrayObject) {
intern->std.handlers = &spl_handler_ArrayObject;
if (parent == spl_ce_ArrayIterator || parent == spl_ce_RecursiveArrayIterator || parent == spl_ce_ArrayObject) {
break;
}
parent = parent->parent;
@ -1781,6 +1777,7 @@ PHP_MINIT_FUNCTION(spl_array)
{
spl_ce_ArrayObject = register_class_ArrayObject(zend_ce_aggregate, zend_ce_arrayaccess, zend_ce_serializable, zend_ce_countable);
spl_ce_ArrayObject->create_object = spl_array_object_new;
spl_ce_ArrayObject->default_object_handlers = &spl_handler_ArrayObject;
memcpy(&spl_handler_ArrayObject, &std_object_handlers, sizeof(zend_object_handlers));
@ -1806,6 +1803,7 @@ PHP_MINIT_FUNCTION(spl_array)
spl_ce_ArrayIterator = register_class_ArrayIterator(spl_ce_SeekableIterator, zend_ce_arrayaccess, zend_ce_serializable, zend_ce_countable);
spl_ce_ArrayIterator->create_object = spl_array_object_new;
spl_ce_ArrayIterator->default_object_handlers = &spl_handler_ArrayIterator;
spl_ce_ArrayIterator->get_iterator = spl_array_get_iterator;
memcpy(&spl_handler_ArrayIterator, &spl_handler_ArrayObject, sizeof(zend_object_handlers));