From: Bruno Haible Date: Tue, 5 Nov 2024 21:16:12 +0000 (+0100) Subject: realloc-posix: Fix link error (regression yesterday). X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=0e381f8397e30a68d3c89dc1c3d042280076a49b;p=gnulib.git realloc-posix: Fix link error (regression yesterday). * lib/stdlib.in.h (realloc): Don't inline rpl_realloc if IN_GNULIB_TESTS is defined. * modules/realloc-posix (Depends-on, configure.ac): Compile realloc.c also if REPLACE_REALLOC_FOR_REALLOC_POSIX is 2. --- diff --git a/ChangeLog b/ChangeLog index 04edcf39e9..5cdadffad7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2024-11-05 Bruno Haible + + realloc-posix: Fix link error (regression yesterday). + * lib/stdlib.in.h (realloc): Don't inline rpl_realloc if IN_GNULIB_TESTS + is defined. + * modules/realloc-posix (Depends-on, configure.ac): Compile realloc.c + also if REPLACE_REALLOC_FOR_REALLOC_POSIX is 2. + 2024-11-05 Bruno Haible stdlib: Add a copyright header. diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h index 7344157263..0d3e2cbf94 100644 --- a/lib/stdlib.in.h +++ b/lib/stdlib.in.h @@ -1461,7 +1461,7 @@ _GL_WARN_ON_USE (setstate_r, "setstate_r is unportable - " #if @GNULIB_REALLOC_POSIX@ # if @REPLACE_REALLOC_FOR_REALLOC_POSIX@ -# if @REPLACE_REALLOC_FOR_REALLOC_POSIX@ == 2 +# if @REPLACE_REALLOC_FOR_REALLOC_POSIX@ == 2 && !IN_GNULIB_TESTS # define _GL_INLINE_RPL_REALLOC 1 _GL_STDLIB_INLINE void * rpl_realloc (void *ptr, size_t size) @@ -1474,7 +1474,7 @@ rpl_realloc (void *ptr, size_t size) # undef realloc # define realloc rpl_realloc # endif -# if @REPLACE_REALLOC_FOR_REALLOC_POSIX@ != 2 +# if !defined _GL_INLINE_RPL_REALLOC _GL_FUNCDECL_RPL (realloc, void *, (void *ptr, size_t size), _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_NODISCARD); diff --git a/modules/realloc-posix b/modules/realloc-posix index b19c82f792..236afa3113 100644 --- a/modules/realloc-posix +++ b/modules/realloc-posix @@ -8,13 +8,13 @@ m4/malloc.m4 Depends-on: extensions-aix -stdckdint [test $REPLACE_REALLOC_FOR_REALLOC_POSIX = 1] +stdckdint [test $REPLACE_REALLOC_FOR_REALLOC_POSIX != 0] stdlib configure.ac: gl_FUNC_REALLOC_POSIX gl_FUNC_REALLOC_0_NONNULL -if test $REPLACE_REALLOC_FOR_REALLOC_POSIX = 1; then +if test $REPLACE_REALLOC_FOR_REALLOC_POSIX != 0; then AC_LIBOBJ([realloc]) fi gl_STDLIB_MODULE_INDICATOR([realloc-posix])