Use AC_CHECK_TYPES for checking struct flock (#13397)

The struct flock is defined in fcntl.h, if system has it. This removes
redundant PHP_STRUCT_FLOCK M4 macro in favor of the AC_CHECK_TYPES,
which by default defines symbol HAVE_STRUCT_FLOCK.
This commit is contained in:
Peter Kokot 2024-02-15 19:17:01 +01:00 committed by GitHub
parent ce96aa9188
commit 9588796294
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 2 additions and 20 deletions

View File

@ -68,6 +68,7 @@ PHP 8.4 INTERNALS UPGRADE NOTES
- Symbol HAVE_BSD_ICONV has been removed.
- M4 macro PHP_DEFINE (atomic includes) removed (use AC_DEFINE and config.h).
- M4 macro PHP_WITH_SHARED has been removed (use PHP_ARG_WITH).
- M4 macro PHP_STRUCT_FLOCK has been removed (use AC_CHECK_TYPES).
c. Windows build system changes
- The configure options --with-oci8-11g, --with-oci8-12c, --with-oci8-19 have

View File

@ -1242,25 +1242,6 @@ AC_DEFUN([PHP_MISSING_TIME_R_DECL],[
AC_MSG_RESULT([done])
])
dnl
dnl PHP_STRUCT_FLOCK
dnl
AC_DEFUN([PHP_STRUCT_FLOCK],[
AC_CACHE_CHECK(for struct flock,ac_cv_struct_flock,
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <unistd.h>
#include <fcntl.h>
]], [[struct flock x;]])],[
ac_cv_struct_flock=yes
],[
ac_cv_struct_flock=no
])
)
if test "$ac_cv_struct_flock" = "yes" ; then
AC_DEFINE(HAVE_STRUCT_FLOCK, 1,[whether you have struct flock])
fi
])
dnl
dnl PHP_SOCKADDR_CHECKS
dnl

View File

@ -464,8 +464,8 @@ dnl ----------------------------------------------------------------------------
AC_STRUCT_TIMEZONE
PHP_MISSING_TIME_R_DECL
PHP_STRUCT_FLOCK
AC_CHECK_TYPES([struct flock],,,[#include <fcntl.h>])
AC_CHECK_TYPES(socklen_t, [], [], [
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>