+2024-11-11 Bruno Haible <bruno@clisp.org>
+
+ realloc-posix: Fix link error (regression 2024-11-04).
+ * doc/extern-inline.texi (extern inline): Mention that one needs a
+ *_INLINE macro per compilation unit.
+ * lib/stdlib.in.h (_GL_REALLOC_INLINE): New macro.
+ (rpl_realloc): Use it. Don't test IN_GNULIB_TESTS.
+ * lib/realloc.c (_GL_REALLOC_INLINE): Define.
+
2024-11-11 Bruno Haible <bruno@clisp.org>
file-has-acl: Fix compilation errors on macOS et al. (regr. 2024-11-09).
inline} so they suffer from code bloat, but they are not mainline
platforms and will die out eventually.
+In this coding idiom,
+you need one @code{AAA_INLINE}-like macro per compilation unit,
+not one per header file.
+In other words, if the header file @file{aaa.h} defines functions
+defined in @file{aaa-foo.c} and @file{aaa-bar.c},
+you need different macros @code{AAA_FOO_INLINE} and @code{AAA_BAR_INLINE}.
+Use @code{AAA_FOO_INLINE} for the functions defined in @file{aaa-foo.c},
+and use @code{AAA_BAR_INLINE} for the functions defined in @file{aaa-bar.c}.
+
@findex _GL_INLINE
@code{_GL_INLINE} is a portable alternative to C99 plain @code{inline}.
#define _GL_USE_STDLIB_ALLOC 1
#include <config.h>
+#define _GL_REALLOC_INLINE _GL_EXTERN_INLINE
#include <stdlib.h>
#include <errno.h>
#ifndef _GL_STDLIB_INLINE
# define _GL_STDLIB_INLINE _GL_INLINE
#endif
+#ifndef _GL_REALLOC_INLINE
+# define _GL_REALLOC_INLINE _GL_INLINE
+#endif
/* _GL_ATTRIBUTE_DEALLOC (F, I) declares that the function returns pointers
that can be freed by passing them as the Ith argument to the
#if @GNULIB_REALLOC_POSIX@
# if @REPLACE_REALLOC_FOR_REALLOC_POSIX@
-# if @REPLACE_REALLOC_FOR_REALLOC_POSIX@ == 2 && !IN_GNULIB_TESTS
+# if @REPLACE_REALLOC_FOR_REALLOC_POSIX@ == 2
# define _GL_INLINE_RPL_REALLOC 1
-_GL_STDLIB_INLINE void *
+_GL_REALLOC_INLINE void *
rpl_realloc (void *ptr, size_t size)
{
return realloc (ptr, size ? size : 1);