From ecd37602a3776d83ad9b3008627e3882072e05c6 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Thu, 15 Feb 2024 13:18:38 +0100 Subject: [PATCH] Use AC_CHECK_TYPES for checking struct flock 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. --- UPGRADING.INTERNALS | 1 + build/php.m4 | 19 ------------------- configure.ac | 2 +- 3 files changed, 2 insertions(+), 20 deletions(-) diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 4c2417fc380a5..820705e8b6d2f 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -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 diff --git a/build/php.m4 b/build/php.m4 index a2b36bf4d4348..326c312674dfc 100644 --- a/build/php.m4 +++ b/build/php.m4 @@ -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 -#include - ]], [[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 diff --git a/configure.ac b/configure.ac index 70334bf55ee06..1e74b29669244 100644 --- a/configure.ac +++ b/configure.ac @@ -464,8 +464,8 @@ dnl ---------------------------------------------------------------------------- AC_STRUCT_TIMEZONE PHP_MISSING_TIME_R_DECL -PHP_STRUCT_FLOCK +AC_CHECK_TYPES([struct flock],,,[#include ]) AC_CHECK_TYPES(socklen_t, [], [], [ #ifdef HAVE_SYS_TYPES_H # include