From 21e3fffb818f81a559006a62ad0f1456157a1767 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 16 Feb 2025 15:46:06 +0100 Subject: [PATCH] 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. --- ChangeLog | 6 ++++++ lib/stdlib.in.h | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index 9e53cd9610..e39f65cb3c 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-12 Bruno Haible setlocale: Update info about Galician and Tamil. diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h index f8e2a6ce34..5838de8312 100644 --- a/lib/stdlib.in.h +++ b/lib/stdlib.in.h @@ -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) -- 2.39.5