diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index c4ad30b9bad5f..83ef90e555879 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -75,12 +75,19 @@ PHP 8.6 INTERNALS UPGRADE NOTES 2. Build system changes ======================== +- Abstract: + . Minimum required PHP version found on the host system for running scripts + like build/gen_stub.php during development has been updated from 7.4 to 8.1. . build/gen_stub.php may now generate a _decl.h file in addition to the _arginfo.h file, if the stub declares enums and is annotated with @generate-c-enums. For each enum the file will contain a C enum. Enum values can be compared to the result of zend_enum_fetch_case_id(zend_object*). +- Unix build system changes: + . Symbol HAVE_ST_BLOCKS has been removed from php_config.h (use + HAVE_STRUCT_STAT_ST_BLOCKS). + ======================== 3. Module changes ======================== diff --git a/configure.ac b/configure.ac index beeed7eb21115..d89d40ff85c21 100644 --- a/configure.ac +++ b/configure.ac @@ -160,8 +160,8 @@ PHP_RUNPATH_SWITCH dnl Checks for some support/generator progs. PHP_PROG_BISON([3.0.0]) PHP_PROG_RE2C([1.0.3], [--no-generation-date]) -dnl Find installed PHP. Minimum supported version for gen_stub.php is PHP 7.4. -PHP_PROG_PHP([7.4]) +dnl Find installed PHP. Minimum supported version for gen_stub.php is PHP 8.1. +PHP_PROG_PHP([8.1]) PHP_ARG_ENABLE([re2c-cgoto], [whether to enable computed goto extension with re2c], @@ -504,11 +504,11 @@ AS_VAR_IF([php_cv_have_alignof], [yes], dnl Check for structure members. AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[#include ]) -AC_CHECK_MEMBERS([struct stat.st_blksize, struct stat.st_rdev]) -dnl AC_STRUCT_ST_BLOCKS will screw QNX because fileblocks.o does not exist. -if test "$(uname -s 2>/dev/null)" != "QNX"; then - AC_STRUCT_ST_BLOCKS -fi +AC_CHECK_MEMBERS(m4_normalize([ + struct stat.st_blksize, + struct stat.st_blocks, + struct stat.st_rdev +])) dnl Checks for types. AC_TYPE_UID_T diff --git a/ext/dom/xpath.c b/ext/dom/xpath.c index 21baa59ffed0b..ce17c0810835a 100644 --- a/ext/dom/xpath.c +++ b/ext/dom/xpath.c @@ -227,10 +227,7 @@ PHP_METHOD(DOMXPath, registerNamespace) RETURN_THROWS(); } - if (xmlXPathRegisterNs(ctxp, prefix, ns_uri) != 0) { - RETURN_FALSE; - } - RETURN_TRUE; + RETURN_BOOL(xmlXPathRegisterNs(ctxp, prefix, ns_uri) == 0); } /* }}} */ diff --git a/ext/phar/func_interceptors.c b/ext/phar/func_interceptors.c index f7e553a45ce80..5d5242e590092 100644 --- a/ext/phar/func_interceptors.c +++ b/ext/phar/func_interceptors.c @@ -631,8 +631,10 @@ static void phar_file_stat(const char *filename, size_t filename_length, int typ if (data) { sb.st_ino = data->inode; } -#ifndef PHP_WIN32 +#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE sb.st_blksize = -1; +#endif +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS sb.st_blocks = -1; #endif phar_fancy_stat(&sb, type, return_value); diff --git a/ext/phar/stream.c b/ext/phar/stream.c index 4bd1e85666b85..4bd53c98fced6 100644 --- a/ext/phar/stream.c +++ b/ext/phar/stream.c @@ -526,8 +526,10 @@ void phar_dostat(phar_archive_data *phar, phar_entry_info *data, php_stream_stat if (!is_temp_dir) { ssb->sb.st_ino = data->inode; } -#ifndef PHP_WIN32 +#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE ssb->sb.st_blksize = -1; +#endif +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS ssb->sb.st_blocks = -1; #endif } diff --git a/ext/zip/zip_stream.c b/ext/zip/zip_stream.c index 50f097de3c876..3a5e56d071f50 100644 --- a/ext/zip/zip_stream.c +++ b/ext/zip/zip_stream.c @@ -177,8 +177,10 @@ static int php_zip_ops_stat(php_stream *stream, php_stream_statbuf *ssb) /* {{{ ssb->sb.st_ctime = sb.mtime; ssb->sb.st_nlink = 1; ssb->sb.st_rdev = -1; -#ifndef PHP_WIN32 +#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE ssb->sb.st_blksize = -1; +#endif +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS ssb->sb.st_blocks = -1; #endif ssb->sb.st_ino = -1; diff --git a/main/streams/memory.c b/main/streams/memory.c index 2f411ff8e8c9c..66e0abe2c5fd9 100644 --- a/main/streams/memory.c +++ b/main/streams/memory.c @@ -213,8 +213,10 @@ static int php_stream_memory_stat(php_stream *stream, php_stream_statbuf *ssb) / /* generate unique inode number for alias/filename, so no phars will conflict */ ssb->sb.st_ino = 0; -#ifndef PHP_WIN32 +#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE ssb->sb.st_blksize = -1; +#endif +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS ssb->sb.st_blocks = -1; #endif