1
0
mirror of https://github.com/php/php-src.git synced 2026-04-28 10:43:30 +02:00

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.
This commit is contained in:
Peter Kokot
2019-03-14 23:21:17 +01:00
parent b6f9ade9f2
commit ccc29473ec
12 changed files with 37 additions and 70 deletions
+5 -23
View File
@@ -1745,25 +1745,6 @@ AC_DEFUN([PHP_SHLIB_SUFFIX_NAMES],[
esac
])
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
@@ -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>
-6
View File
@@ -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)
+5 -6
View File
@@ -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"
])
+8 -4
View File
@@ -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
-1
View File
@@ -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
+5 -6
View File
@@ -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
+1 -1
View File
@@ -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)
{
+13 -9
View File
@@ -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)
-10
View File
@@ -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)
])
-1
View File
@@ -7,6 +7,5 @@ AC_REQUIRE([AC_PROG_RANLIB])
AC_DEFINE(UNDEF_THREADS_HACK,,[ ])
XMLRPC_HEADER_CHECKS
XMLRPC_TYPE_CHECKS
XMLRPC_FUNCTION_CHECKS
])
-2
View File
@@ -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
-1
View File
@@ -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