From bbdbc2658cb60b42652a398571de6402b5007f54 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Thu, 18 Jul 2019 12:11:19 +0200 Subject: [PATCH] Remove duplicate socklen_t check - Use Autoconf's default AC_CHECK_TYPES Closes GH-4418 --- build/php.m4 | 20 -------------------- configure.ac | 10 +++++++++- sapi/cgi/config9.m4 | 6 ------ 3 files changed, 9 insertions(+), 27 deletions(-) diff --git a/build/php.m4 b/build/php.m4 index a17a4b9b60..3624a33a8e 100644 --- a/build/php.m4 +++ b/build/php.m4 @@ -1322,26 +1322,6 @@ if test "$ac_cv_struct_flock" = "yes" ; then fi ]) -dnl -dnl PHP_SOCKLEN_T -dnl -AC_DEFUN([PHP_SOCKLEN_T],[ -AC_CACHE_CHECK(for socklen_t,ac_cv_socklen_t, - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#include -#include -]],[[ -socklen_t x; -]])],[ - ac_cv_socklen_t=yes -],[ - ac_cv_socklen_t=no -])) -if test "$ac_cv_socklen_t" = "yes"; then - AC_DEFINE(HAVE_SOCKLEN_T, 1, [Whether you have socklen_t]) -fi -]) - dnl dnl PHP_MISSING_FCLOSE_DECL dnl diff --git a/configure.ac b/configure.ac index 67082077c8..36c6e5e3e2 100644 --- a/configure.ac +++ b/configure.ac @@ -498,7 +498,15 @@ AC_STRUCT_TIMEZONE PHP_MISSING_TIME_R_DECL PHP_MISSING_FCLOSE_DECL PHP_STRUCT_FLOCK -PHP_SOCKLEN_T + +AC_CHECK_TYPES(socklen_t, [], [], [ + #ifdef HAVE_SYS_TYPES_H + # include + #endif + #ifdef HAVE_SYS_SOCKET_H + # include + #endif +]) dnl These are defined elsewhere than stdio.h. PHP_CHECK_SIZEOF(intmax_t, 0) diff --git a/sapi/cgi/config9.m4 b/sapi/cgi/config9.m4 index a26f417933..ae927cd5f8 100644 --- a/sapi/cgi/config9.m4 +++ b/sapi/cgi/config9.m4 @@ -8,12 +8,6 @@ dnl CGI setup. AC_MSG_CHECKING(for CGI build) if test "$PHP_CGI" != "no"; then AC_MSG_RESULT(yes) - AC_MSG_CHECKING([for socklen_t in sys/socket.h]) - AC_EGREP_HEADER([socklen_t], [sys/socket.h], - [AC_MSG_RESULT([yes]) - AC_DEFINE([HAVE_SOCKLEN_T], [1], - [Define if the socklen_t typedef is in sys/socket.h])], - AC_MSG_RESULT([no])) AC_MSG_CHECKING([for sun_len in sys/un.h]) AC_EGREP_HEADER([sun_len], [sys/un.h], -- 2.40.0