From: Bruno Haible Date: Sun, 16 Feb 2025 14:46:06 +0000 (+0100) Subject: realloc: Fix link error in C++ mode on CentOS 5 (regression 2024-11-04). X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=183cdca27d86b041c85ee5e7926598626db1ee4c;p=thirdparty%2Fgnulib.git realloc: Fix link error in C++ mode on CentOS 5 (regression 2024-11-04). * lib/stdlib.in.h (rpl_realloc): Ensure C linkage, not C++ linkage, in C++ mode. --- diff --git a/ChangeLog b/ChangeLog index 5829c3bd9e..549db282db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2025-02-16 Bruno Haible + + realloc: Fix link error in C++ mode on CentOS 5 (regression 2024-11-04). + * lib/stdlib.in.h (rpl_realloc): Ensure C linkage, not C++ linkage, in + C++ mode. + 2025-02-16 Bruno Haible c-strcasecmp, c-strncasecmp: New modules. diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h index 11d337a18a..2077a63fc6 100644 --- a/lib/stdlib.in.h +++ b/lib/stdlib.in.h @@ -1473,11 +1473,17 @@ _GL_WARN_ON_USE (setstate_r, "setstate_r is unportable - " # if @REPLACE_REALLOC_FOR_REALLOC_POSIX@ # if @REPLACE_REALLOC_FOR_REALLOC_POSIX@ == 2 # define _GL_INLINE_RPL_REALLOC 1 +# ifdef __cplusplus +extern "C" { +# endif _GL_REALLOC_INLINE void * rpl_realloc (void *ptr, size_t size) { return realloc (ptr, size ? size : 1); } +# ifdef __cplusplus +} +# endif # endif # if !((defined __cplusplus && defined GNULIB_NAMESPACE) \ || _GL_USE_STDLIB_ALLOC)