]> granicus.if.org Git - php/commitdiff
Sync AC_CHECK_SIZEOF m4 macro calls
authorPeter Kokot <peterkokot@gmail.com>
Thu, 14 Mar 2019 22:21:17 +0000 (23:21 +0100)
committerPeter Kokot <peterkokot@gmail.com>
Mon, 18 Mar 2019 01:11:23 +0000 (02:11 +0100)
- 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.

12 files changed:
acinclude.m4
configure.ac
ext/hash/config.m4
ext/ldap/config.m4
ext/mysqlnd/config-win.h
ext/oci8/config.m4
ext/opcache/ZendAccelerator.c
ext/pdo_oci/config.m4
ext/xmlrpc/libxmlrpc/acinclude.m4
ext/xmlrpc/libxmlrpc/xmlrpc.m4
main/snprintf.h
win32/build/config.w32.h.in

index 1684c74a92916ccac91ae943f1dc3d0501def92d..9b32e5c9eaa45f19c99835e23faccb84c88c4acb 100644 (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>
index 8fca2885b2a7eba096cbdc1da58c8f75831d7827..67aa92b84cde7d4400d1b41cb78d2a587c20bdfc 100644 (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)
index 53f57d6dda4825bd14e5995960a820ef388877a5..01582373902d46a169557d20e05bb533c243d618 100644 (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"
   ])
index 8b94c06225ff5e97dadd3c23ed2484facded7398..7653bf9344c8bcd0f2c2a4182596aff84d9508a7 100644 (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
index d93b3bf9f9a9ffa7f70098842ccf6861c7325e54..1047664f64df2dc87e8c6db636f80685a94f388d 100644 (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
 
index 00a51c815b51c58fb16f58e5a76d9182654cf02a..d534f09107b2043366eec495efae53fdb64e9d68 100644 (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
 
index de6b86fdf4a7fa96afe961c1b3a2abb25f08f755..73fd894154ecd1a5e8e9178a2aee38cb18e7f39e 100644 (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)
 {
index 12791b2fe084a35f35086edf732b6a379cddc6a7..c692483394f2465abd90ce8c0115a746ad171c0a 100644 (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)
 
index 0c63d953568e80688c57183d8a26e86be8725718..0b730fa36d5d7a432f9de771c54ae1a99142d742 100644 (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)
-])
index 955376072f935ffa27430bbad7517e3693b06685..5e9552b3c167d82e5c029dfe2c3770cef20ac0d6 100644 (file)
@@ -7,6 +7,5 @@ AC_REQUIRE([AC_PROG_RANLIB])
 AC_DEFINE(UNDEF_THREADS_HACK,,[ ])
 
 XMLRPC_HEADER_CHECKS
-XMLRPC_TYPE_CHECKS
 XMLRPC_FUNCTION_CHECKS
 ])
index 56efe5625c118c6278d559a17752f95edd35fb3f..93d2034bb6311e87acc293e6d993804819344889 100644 (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
index b2d944c14d693b152d7ac3ce94dca273145ccb91..938af691a244792362591a5c5a3b5efa8ee15d40 100644 (file)
 #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