]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix detection and handling of strchrnul() for macOS 15.4.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 1 Apr 2025 20:49:51 +0000 (16:49 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 1 Apr 2025 20:49:51 +0000 (16:49 -0400)
commit71790aef1a6eea6f9662a1edcd669d89d5486b03
treeda68c895bc4573ea23804bb0d9e458d7f7cf6082
parent5ff827389e7739c05888218bd9cd123f0b9b3122
Fix detection and handling of strchrnul() for macOS 15.4.

As of 15.4, macOS has strchrnul(), but access to it is blocked behind
a check for MACOSX_DEPLOYMENT_TARGET >= 15.4.  But our does-it-link
configure check finds it, so we try to use it, and fail with the
present default deployment target (namely 15.0).  This accounts for
today's buildfarm failures on indri and sifaka.

This is the identical problem that we faced some years ago when Apple
introduced preadv and pwritev in the same way.  We solved that in
commit f014b1b9b by using AC_CHECK_DECLS instead of AC_CHECK_FUNCS
to check the functions' availability.  So do the same now for
strchrnul().  Interestingly, we already had a workaround for
"the link check doesn't agree with <string.h>" cases with glibc,
which we no longer need since only the header declaration is being
checked.

Testing this revealed that the meson version of this check has never
worked, because it failed to use "-Werror=unguarded-availability-new".
(Apparently nobody's tried to build with meson on macOS versions that
lack preadv/pwritev as standard.)  Adjust that while at it.  Also,
we had never put support for "-Werror=unguarded-availability-new"
into v13, but we need that now.

Co-authored-by: Tom Lane <tgl@sss.pgh.pa.us>
Co-authored-by: Peter Eisentraut <peter@eisentraut.org>
Discussion: https://postgr.es/m/385134.1743523038@sss.pgh.pa.us
Backpatch-through: 13
configure
configure.ac
src/include/pg_config.h.in
src/port/snprintf.c
src/tools/msvc/Solution.pm