diff options
author | Peter Kokot <peterkokot@gmail.com> | 2019-03-14 23:21:17 +0100 |
---|---|---|
committer | Peter Kokot <peterkokot@gmail.com> | 2019-03-18 02:11:23 +0100 |
commit | ccc29473ecdb07d9735e7b6361b7daeec6c3ede1 (patch) | |
tree | b359c40cbd61053f672c598ec0275ae9e7938de2 | |
parent | b6f9ade9f201c852430689caf8ed8af0ded0159a (diff) | |
download | php-git-ccc29473ecdb07d9735e7b6361b7daeec6c3ede1.tar.gz |
Sync AC_CHECK_SIZEOF m4 macro calls
- AC_CHECK_SIZEOF is now called mostly only in PHP_CHECK_STDINT_TYPES()
macro except for some parts checking for the 32 or 64 bit architecture.
- SIZEOF_CHAR removed since it is always 1
- ZEND_BIN_ID is now of a more logical pattern `BIN_48888` on 64bit
architectures and `BIN_44444` on 32bit instead of literal string
`BIN_SIZEOF_CHAR48888` on 64bit and `BIN_SIZEOF_CHAR44444` on 32bit.
The unneeded SIZEOF_CHAR part has been removed.
- XMLRPC_TYPE_CHECKS removed
- The `long long int` is the same as `long long` and redundant checks
removed accordingly.
- Removed PHP_CHECK_64BIT macro. Checking if current platform is 64bit
or not can be also done simply by using a check of the long type on
place. This removes redundant m4 macro PHP_CHECK_64BIT.
-rw-r--r-- | acinclude.m4 | 28 | ||||
-rw-r--r-- | configure.ac | 6 | ||||
-rw-r--r-- | ext/hash/config.m4 | 11 | ||||
-rw-r--r-- | ext/ldap/config.m4 | 12 | ||||
-rw-r--r-- | ext/mysqlnd/config-win.h | 1 | ||||
-rw-r--r-- | ext/oci8/config.m4 | 11 | ||||
-rw-r--r-- | ext/opcache/ZendAccelerator.c | 2 | ||||
-rw-r--r-- | ext/pdo_oci/config.m4 | 22 | ||||
-rw-r--r-- | ext/xmlrpc/libxmlrpc/acinclude.m4 | 10 | ||||
-rw-r--r-- | ext/xmlrpc/libxmlrpc/xmlrpc.m4 | 1 | ||||
-rw-r--r-- | main/snprintf.h | 2 | ||||
-rw-r--r-- | win32/build/config.w32.h.in | 1 |
12 files changed, 37 insertions, 70 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index 1684c74a92..9b32e5c9ea 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1746,25 +1746,6 @@ AC_DEFUN([PHP_SHLIB_SUFFIX_NAMES],[ ]) dnl -dnl PHP_CHECK_64BIT([do if 32], [do if 64]) -dnl -dnl This macro is used to detect if we're at 64-bit platform or not. -dnl It could be useful for those external libs, that have different precompiled -dnl versions in different directories. -dnl -AC_DEFUN([PHP_CHECK_64BIT],[ - AC_CHECK_SIZEOF(long int, 4) - AC_MSG_CHECKING([checking if we're at 64-bit platform]) - if test "$ac_cv_sizeof_long_int" = "4" ; then - AC_MSG_RESULT([no]) - $1 - else - AC_MSG_RESULT([yes]) - $2 - fi -]) - -dnl dnl PHP_C_BIGENDIAN dnl dnl Replacement macro for AC_C_BIGENDIAN @@ -2601,10 +2582,11 @@ dnl dnl PHP_CHECK_STDINT_TYPES dnl AC_DEFUN([PHP_CHECK_STDINT_TYPES], [ - AC_CHECK_SIZEOF([short], 2) - AC_CHECK_SIZEOF([int], 4) - AC_CHECK_SIZEOF([long], 4) - AC_CHECK_SIZEOF([long long], 8) + AC_CHECK_SIZEOF([short]) + AC_CHECK_SIZEOF([int]) + AC_CHECK_SIZEOF([long]) + AC_CHECK_SIZEOF([long long]) + AC_CHECK_SIZEOF([size_t]) AC_CHECK_TYPES([int8, int16, int32, int64, int8_t, int16_t, int32_t, int64_t, uint8, uint16, uint32, uint64, uint8_t, uint16_t, uint32_t, uint64_t, u_int8_t, u_int16_t, u_int32_t, u_int64_t], [], [], [ #if HAVE_STDINT_H # include <stdint.h> diff --git a/configure.ac b/configure.ac index 8fca2885b2..67aa92b84c 100644 --- a/configure.ac +++ b/configure.ac @@ -507,12 +507,6 @@ PHP_MISSING_FCLOSE_DECL PHP_STRUCT_FLOCK PHP_SOCKLEN_T -AC_CHECK_SIZEOF(size_t, 8) -AC_CHECK_SIZEOF(long long, 8) -AC_CHECK_SIZEOF(long long int, 8) -AC_CHECK_SIZEOF(long, 8) -AC_CHECK_SIZEOF(int, 4) - dnl These are defined elsewhere than stdio.h PHP_CHECK_SIZEOF(intmax_t, 0) PHP_CHECK_SIZEOF(ssize_t, 8) diff --git a/ext/hash/config.m4 b/ext/hash/config.m4 index 53f57d6dda..0158237390 100644 --- a/ext/hash/config.m4 +++ b/ext/hash/config.m4 @@ -15,20 +15,19 @@ fi AC_DEFINE(HAVE_HASH_EXT,1,[Have HASH Extension]) -AC_CHECK_SIZEOF(short, 2) -AC_CHECK_SIZEOF(int, 4) -AC_CHECK_SIZEOF(long, 4) -AC_CHECK_SIZEOF(long long, 8) - if test $ac_cv_c_bigendian_php = yes; then EXT_HASH_SHA3_SOURCES="hash_sha3.c" AC_DEFINE(HAVE_SLOW_HASH3, 1, [Define is hash3 algo is available]) AC_MSG_WARN("Use SHA3 slow implementation on bigendian") else - PHP_CHECK_64BIT([ + AC_CHECK_SIZEOF([long]) + AC_MSG_CHECKING([if we're at 64-bit platform]) + AS_IF([test "$ac_cv_sizeof_long" -eq 4],[ + AC_MSG_RESULT([no]) SHA3_DIR="sha3/generic32lc" SHA3_OPT_SRC="$SHA3_DIR/KeccakP-1600-inplace32BI.c" ],[ + AC_MSG_RESULT([yes]) SHA3_DIR="sha3/generic64lc" SHA3_OPT_SRC="$SHA3_DIR/KeccakP-1600-opt64.c" ]) diff --git a/ext/ldap/config.m4 b/ext/ldap/config.m4 index 8b94c06225..7653bf9344 100644 --- a/ext/ldap/config.m4 +++ b/ext/ldap/config.m4 @@ -16,12 +16,16 @@ AC_DEFUN([PHP_LDAP_CHECKS], [ else dnl Find Oracle Instant Client RPM header location corresponding to the given lib path e.g. for --with-ldap=/usr/lib/oracle/12.1/client64/lib - AC_CHECK_SIZEOF(long int, 4) - if test "$ac_cv_sizeof_long_int" = "4"; then + AC_CHECK_SIZEOF([long]) + AC_MSG_CHECKING([if we're at 64-bit platform]) + AS_IF([test "$ac_cv_sizeof_long" -eq 4],[ + AC_MSG_RESULT([no]) PHP_OCI8_IC_LIBDIR_SUFFIX="" - else + ],[ + AC_MSG_RESULT([yes]) PHP_OCI8_IC_LIBDIR_SUFFIX=64 - fi + ]) + OCISDKRPMINC=`echo "$1" | $SED -e 's!^/usr/lib/oracle/\(.*\)/client\('${PHP_OCI8_IC_LIBDIR_SUFFIX}'\)*/lib[/]*$!/usr/include/oracle/\1/client\2!'` dnl Check for Oracle Instant Client RPM install diff --git a/ext/mysqlnd/config-win.h b/ext/mysqlnd/config-win.h index d93b3bf9f9..1047664f64 100644 --- a/ext/mysqlnd/config-win.h +++ b/ext/mysqlnd/config-win.h @@ -55,7 +55,6 @@ This file is public domain and comes with NO WARRANTY of any kind */ /* Type information */ -#define SIZEOF_CHAR 1 #define SIZEOF_LONG 4 #define SIZEOF_LONG_LONG 8 diff --git a/ext/oci8/config.m4 b/ext/oci8/config.m4 index 00a51c815b..d534f09107 100644 --- a/ext/oci8/config.m4 +++ b/ext/oci8/config.m4 @@ -239,18 +239,17 @@ if test "$PHP_OCI8" != "no"; then fi dnl Set some port specific directory components for use later - - AC_CHECK_SIZEOF(long int, 4) - AC_MSG_CHECKING([checking if we're on a 64-bit platform]) - if test "$ac_cv_sizeof_long_int" = "4"; then + AC_CHECK_SIZEOF([long]) + AC_MSG_CHECKING([if we're at 64-bit platform]) + AS_IF([test "$ac_cv_sizeof_long" -eq 4],[ AC_MSG_RESULT([no]) PHP_OCI8_OH_LIBDIR=lib32 PHP_OCI8_IC_LIBDIR_SUFFIX="" - else + ],[ AC_MSG_RESULT([yes]) PHP_OCI8_OH_LIBDIR=lib PHP_OCI8_IC_LIBDIR_SUFFIX=64 - fi + ]) dnl Determine if the user wants to use Oracle Instant Client libraries diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index de6b86fdf4..73fd894154 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -2562,7 +2562,7 @@ static void accel_globals_ctor(zend_accel_globals *accel_globals) accel_gen_system_id(); } -#define ZEND_BIN_ID "BIN_" ZEND_TOSTR(SIZEOF_CHAR) ZEND_TOSTR(SIZEOF_INT) ZEND_TOSTR(SIZEOF_LONG) ZEND_TOSTR(SIZEOF_SIZE_T) ZEND_TOSTR(SIZEOF_ZEND_LONG) ZEND_TOSTR(ZEND_MM_ALIGNMENT) +#define ZEND_BIN_ID "BIN_" ZEND_TOSTR(SIZEOF_INT) ZEND_TOSTR(SIZEOF_LONG) ZEND_TOSTR(SIZEOF_SIZE_T) ZEND_TOSTR(SIZEOF_ZEND_LONG) ZEND_TOSTR(ZEND_MM_ALIGNMENT) static void accel_gen_system_id(void) { diff --git a/ext/pdo_oci/config.m4 b/ext/pdo_oci/config.m4 index 12791b2fe0..c692483394 100644 --- a/ext/pdo_oci/config.m4 +++ b/ext/pdo_oci/config.m4 @@ -30,15 +30,15 @@ AC_DEFUN([AC_PDO_OCI_VERSION],[ ]) AC_DEFUN([AC_PDO_OCI_CHECK_LIB_DIR],[ - AC_CHECK_SIZEOF(long int, 4) - AC_MSG_CHECKING([if we're on a 64-bit platform]) - if test "$ac_cv_sizeof_long_int" = "4" ; then + AC_CHECK_SIZEOF([long]) + AC_MSG_CHECKING([if we're at 64-bit platform]) + AS_IF([test "$ac_cv_sizeof_long" -eq 4],[ AC_MSG_RESULT([no]) TMP_PDO_OCI_LIB_DIR="$PDO_OCI_DIR/lib32" - else + ],[ AC_MSG_RESULT([yes]) TMP_PDO_OCI_LIB_DIR="$PDO_OCI_DIR/lib" - fi + ]) AC_MSG_CHECKING([OCI8 libraries dir]) if test -d "$PDO_OCI_DIR/lib" && test ! -d "$PDO_OCI_DIR/lib32"; then @@ -82,12 +82,16 @@ if test "$PHP_PDO_OCI" != "no"; then fi if test "instantclient" = "`echo $PDO_OCI_DIR | cut -d, -f1`" ; then - AC_CHECK_SIZEOF(long int, 4) - if test "$ac_cv_sizeof_long_int" = "4" ; then + AC_CHECK_SIZEOF([long]) + AC_MSG_CHECKING([if we're at 64-bit platform]) + AS_IF([test "$ac_cv_sizeof_long" -eq 4],[ + AC_MSG_RESULT([no]) PDO_OCI_CLIENT_DIR="client" - else + ],[ + AC_MSG_RESULT([yes]) PDO_OCI_CLIENT_DIR="client64" - fi + ]) + PDO_OCI_LIB_DIR="`echo $PDO_OCI_DIR | cut -d, -f2`" AC_PDO_OCI_VERSION($PDO_OCI_LIB_DIR) diff --git a/ext/xmlrpc/libxmlrpc/acinclude.m4 b/ext/xmlrpc/libxmlrpc/acinclude.m4 index 0c63d95356..0b730fa36d 100644 --- a/ext/xmlrpc/libxmlrpc/acinclude.m4 +++ b/ext/xmlrpc/libxmlrpc/acinclude.m4 @@ -9,13 +9,3 @@ AC_CHECK_FUNCS(strtoul strtoull) AC_DEFUN([XMLRPC_HEADER_CHECKS],[ AC_CHECK_HEADERS(xmlparse.h xmltok.h strings.h) ]) - -AC_DEFUN([XMLRPC_TYPE_CHECKS],[ - -AC_REQUIRE([AC_C_INLINE]) -AC_CHECK_SIZEOF(char, 1) - -AC_CHECK_SIZEOF(int, 4) -AC_CHECK_SIZEOF(long, 4) -AC_CHECK_SIZEOF(long long, 8) -]) diff --git a/ext/xmlrpc/libxmlrpc/xmlrpc.m4 b/ext/xmlrpc/libxmlrpc/xmlrpc.m4 index 955376072f..5e9552b3c1 100644 --- a/ext/xmlrpc/libxmlrpc/xmlrpc.m4 +++ b/ext/xmlrpc/libxmlrpc/xmlrpc.m4 @@ -7,6 +7,5 @@ AC_REQUIRE([AC_PROG_RANLIB]) AC_DEFINE(UNDEF_THREADS_HACK,,[ ]) XMLRPC_HEADER_CHECKS -XMLRPC_TYPE_CHECKS XMLRPC_FUNCTION_CHECKS ]) diff --git a/main/snprintf.h b/main/snprintf.h index 56efe5625c..93d2034bb6 100644 --- a/main/snprintf.h +++ b/main/snprintf.h @@ -136,8 +136,6 @@ typedef enum { #ifdef PHP_WIN32 # define WIDE_INT __int64 -#elif SIZEOF_LONG_LONG_INT -# define WIDE_INT long long int #elif SIZEOF_LONG_LONG # define WIDE_INT long long #else diff --git a/win32/build/config.w32.h.in b/win32/build/config.w32.h.in index b2d944c14d..938af691a2 100644 --- a/win32/build/config.w32.h.in +++ b/win32/build/config.w32.h.in @@ -109,7 +109,6 @@ #define SIZEOF_INT 4 #define SIZEOF_LONG 4 /* MSVC.6/NET don't allow 'long long' or know 'intmax_t' */ -#define SIZEOF_LONG_LONG_INT 0 #define SIZEOF_LONG_LONG 8 /* defined as __int64 */ #define SIZEOF_INTMAX_T 0 #define ssize_t SSIZE_T |