]> Savannah Git Hosting - gnulib.git/commitdiff
realloc: Fix link error in C++ mode on CentOS 5 (regression 2024-11-04).
authorBruno Haible <bruno@clisp.org>
Sun, 16 Feb 2025 14:46:06 +0000 (15:46 +0100)
committerBruno Haible <bruno@clisp.org>
Fri, 7 Mar 2025 19:58:39 +0000 (20:58 +0100)
* lib/stdlib.in.h (rpl_realloc): Ensure C linkage, not C++ linkage, in
C++ mode.

ChangeLog
lib/stdlib.in.h

index 9e53cd9610e63b35dd33b8d286330b28d628097a..e39f65cb3c1feea9ec90dd8ab58dc23e1b780176 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-02-16  Bruno Haible  <bruno@clisp.org>
+
+       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-12  Bruno Haible  <bruno@clisp.org>
 
        setlocale: Update info about Galician and Tamil.
index f8e2a6ce344ec111da57898256717ada6ecc6ef9..5838de8312c242fc8b0ea7a4e9ed57609841e3ee 100644 (file)
@@ -1472,11 +1472,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)