php-src/ext/posix
Peter Kokot c6f4c26e1b
Check major, minor and makedev with Autoconf's AC_HEADER_MAJOR (#13706)
The non-standard major(), minor(), and makedev() can be defined as
macros. These are usually used together with the Autoconf macro
AC_HEADER_MAJOR, which defines the MAJOR_IN_MKDEV if sys/mkdev.h is
available, or MAJOR_IN_SYSMACROS if sys/sysmacros.h is available.

On Solaris/illumos they are in the sys/mkdev.h header (macro defined to
libc implementation) and in sys/sysmacros.h (macro defined with binary
operators and bits shifting). On systems with musl and glibc 2.28 or
later they are defined in sys/sysmacros.h, in glibc 2.27 and earlier
they were in sys/types.h. On BSD-based systems and macOS they are in the
sys/types.h.

Autoconf 2.70 has fixed the AC_HEADER_MAJOR macro, so it detects the
headers properly due to glibc 2.25 throwing deprecation warnings when
using the macros from sys/types.h. With Autoconf 2.69 and earlier the
ac_cv_header_sys_types_h_makedev cache variable can skip the
improper sys/types.h check in the macro.

This change syncs the usage within the ext/fileinfo/libmagic bundled
library and ext/posix.

When sys/mkdev.h header is available, code includes that, otherwise
it conditionally includes the sys/sysmacros.h. The ext/posix has
additional check whether linker sees the makedev, otherwise it checks
if makedev is declared within the given set of headers accoring to the
AC_HEADER_MAJOR logic. Previously the AC_CHECK_FUNCS didn't detect it.
2024-03-15 21:18:05 +01:00
..
tests ext/posix: posix_isatty() fix use-of-uninitialized-value (#11676) 2023-07-11 23:55:18 +01:00
config.m4 Check major, minor and makedev with Autoconf's AC_HEADER_MAJOR (#13706) 2024-03-15 21:18:05 +01:00
CREDITS
php_posix.h Update http->https in license (#6945) 2021-05-06 12:16:35 +02:00
posix_arginfo.h Implement "support doc comments for internal classes and functions" (#13266) 2024-02-25 08:41:31 +01:00
posix.c Check major, minor and makedev with Autoconf's AC_HEADER_MAJOR (#13706) 2024-03-15 21:18:05 +01:00
posix.stub.php Merge branch 'PHP-8.3' 2023-11-20 13:43:43 +00:00