From: Peter Kokot Date: Thu, 23 Aug 2018 22:33:02 +0000 (+0200) Subject: Replace HAVE_ST_BLOCKS with HAVE_STRUCT_STAT_ST_BLOCKS X-Git-Tag: php-7.4.0alpha1~2061 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3ceecaa9a014c0990c49bd2db1dc16db01254e4b;p=php Replace HAVE_ST_BLOCKS with HAVE_STRUCT_STAT_ST_BLOCKS Since Autoconf 2.50+ macro AC_STRUCT_ST_BLOCKS defines the new HAVE_STRUCT_STAT_ST_BLOCKS symbol and has deprecated the previous HAVE_ST_BLOCKS. PHP 5.3 required Autoconf 2.13 (released in 1999) or newer, since PHP 5.4 the autoconf 2.59 (released in 2003) or newer was required, and since PHP 7.2, autoconf 2.64 (released in 2008) or newer is required. --- diff --git a/ext/phar/func_interceptors.c b/ext/phar/func_interceptors.c index d9d8b04836..eb6dff8d27 100644 --- a/ext/phar/func_interceptors.c +++ b/ext/phar/func_interceptors.c @@ -540,7 +540,7 @@ static void phar_fancy_stat(zend_stat_t *stat_sb, int type, zval *return_value) #else ZVAL_LONG(&stat_blksize,-1); #endif -#ifdef HAVE_ST_BLOCKS +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS ZVAL_LONG(&stat_blocks, stat_sb->st_blocks); #else ZVAL_LONG(&stat_blocks,-1); diff --git a/ext/standard/file.c b/ext/standard/file.c index ef2234dba7..4aae502232 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -1616,7 +1616,7 @@ PHP_NAMED_FUNCTION(php_if_fstat) #else ZVAL_LONG(&stat_blksize,-1); #endif -#ifdef HAVE_ST_BLOCKS +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS ZVAL_LONG(&stat_blocks, stat_ssb.sb.st_blocks); #else ZVAL_LONG(&stat_blocks,-1); diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c index 220b593bfd..68644ac03c 100644 --- a/ext/standard/filestat.c +++ b/ext/standard/filestat.c @@ -948,7 +948,7 @@ PHPAPI void php_stat(const char *filename, size_t filename_length, int type, zva #else ZVAL_LONG(&stat_blksize,-1); #endif -#ifdef HAVE_ST_BLOCKS +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS ZVAL_LONG(&stat_blocks, stat_sb->st_blocks); #else ZVAL_LONG(&stat_blocks,-1); diff --git a/ext/standard/ftp_fopen_wrapper.c b/ext/standard/ftp_fopen_wrapper.c index 8628e9b106..e9bedc2f2a 100644 --- a/ext/standard/ftp_fopen_wrapper.c +++ b/ext/standard/ftp_fopen_wrapper.c @@ -877,7 +877,7 @@ mdtm_error: ssb->sb.st_rdev = -1; #ifdef HAVE_STRUCT_STAT_ST_BLKSIZE ssb->sb.st_blksize = 4096; /* Guess since FTP won't expose this information */ -#ifdef HAVE_ST_BLOCKS +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS ssb->sb.st_blocks = (int)((4095 + ssb->sb.st_size) / ssb->sb.st_blksize); /* emulate ceil */ #endif #endif diff --git a/main/streams/userspace.c b/main/streams/userspace.c index e69db525da..5c144f28b3 100644 --- a/main/streams/userspace.c +++ b/main/streams/userspace.c @@ -865,7 +865,7 @@ static int statbuf_from_array(zval *array, php_stream_statbuf *ssb) #ifdef HAVE_STRUCT_STAT_ST_BLKSIZE STAT_PROP_ENTRY(blksize); #endif -#ifdef HAVE_ST_BLOCKS +#ifdef HAVE_STRUCT_STAT_ST_BLOCKS STAT_PROP_ENTRY(blocks); #endif diff --git a/win32/build/config.w32.h.in b/win32/build/config.w32.h.in index ef72e6814d..74342099c3 100644 --- a/win32/build/config.w32.h.in +++ b/win32/build/config.w32.h.in @@ -67,7 +67,7 @@ #undef HAVE_SYS_TIME_H #define HAVE_SIGNAL_H 1 #undef HAVE_STRUCT_STAT_ST_BLKSIZE -#undef HAVE_ST_BLOCKS +#undef HAVE_STRUCT_STAT_ST_BLOCKS #define HAVE_STRUCT_STAT_ST_RDEV 1 #define HAVE_UTIME_NULL 1 #define HAVE_VPRINTF 1