Remove duplicate socklen_t check

- Use Autoconf's default AC_CHECK_TYPES

Closes GH-4418
This commit is contained in:
Peter Kokot 2019-07-18 12:11:19 +02:00
parent 562591f5eb
commit bbdbc2658c
3 changed files with 9 additions and 27 deletions

View File

@ -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 <sys/types.h>
#include <sys/socket.h>
]],[[
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

View File

@ -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 <sys/types.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
])
dnl These are defined elsewhere than stdio.h.
PHP_CHECK_SIZEOF(intmax_t, 0)

View File

@ -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],