Skip to content

Commit 9588796

Browse files
authored
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.
1 parent ce96aa9 commit 9588796

File tree

3 files changed

+2
-20
lines changed

3 files changed

+2
-20
lines changed

UPGRADING.INTERNALS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ PHP 8.4 INTERNALS UPGRADE NOTES
6868
- Symbol HAVE_BSD_ICONV has been removed.
6969
- M4 macro PHP_DEFINE (atomic includes) removed (use AC_DEFINE and config.h).
7070
- M4 macro PHP_WITH_SHARED has been removed (use PHP_ARG_WITH).
71+
- M4 macro PHP_STRUCT_FLOCK has been removed (use AC_CHECK_TYPES).
7172

7273
c. Windows build system changes
7374
- The configure options --with-oci8-11g, --with-oci8-12c, --with-oci8-19 have

build/php.m4

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,25 +1242,6 @@ AC_DEFUN([PHP_MISSING_TIME_R_DECL],[
12421242
AC_MSG_RESULT([done])
12431243
])
12441244

1245-
dnl
1246-
dnl PHP_STRUCT_FLOCK
1247-
dnl
1248-
AC_DEFUN([PHP_STRUCT_FLOCK],[
1249-
AC_CACHE_CHECK(for struct flock,ac_cv_struct_flock,
1250-
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1251-
#include <unistd.h>
1252-
#include <fcntl.h>
1253-
]], [[struct flock x;]])],[
1254-
ac_cv_struct_flock=yes
1255-
],[
1256-
ac_cv_struct_flock=no
1257-
])
1258-
)
1259-
if test "$ac_cv_struct_flock" = "yes" ; then
1260-
AC_DEFINE(HAVE_STRUCT_FLOCK, 1,[whether you have struct flock])
1261-
fi
1262-
])
1263-
12641245
dnl
12651246
dnl PHP_SOCKADDR_CHECKS
12661247
dnl

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,8 +464,8 @@ dnl ----------------------------------------------------------------------------
464464
AC_STRUCT_TIMEZONE
465465

466466
PHP_MISSING_TIME_R_DECL
467-
PHP_STRUCT_FLOCK
468467

468+
AC_CHECK_TYPES([struct flock],,,[#include <fcntl.h>])
469469
AC_CHECK_TYPES(socklen_t, [], [], [
470470
#ifdef HAVE_SYS_TYPES_H
471471
# include <sys/types.h>

0 commit comments

Comments
 (0)