]> Savannah Git Hosting - gnulib.git/commitdiff
Fix error in C++ mode on glibc systems (regression 2022-04-28).
authorBruno Haible <bruno@clisp.org>
Thu, 9 Feb 2023 12:16:31 +0000 (13:16 +0100)
committerBruno Haible <bruno@clisp.org>
Fri, 10 Feb 2023 03:21:46 +0000 (04:21 +0100)
* lib/string.in.h (rpl_free): Add exception specification like
stdlib.in.h does.
* lib/wchar.in.h (rpl_free): Likewise.

ChangeLog
lib/string.in.h
lib/wchar.in.h

index 051c230b02339d3ea2b20ad3a32ed08a8effe694..66b0c6f7aa38a973527ff674f1b70aee15718012 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2023-02-09  Bruno Haible  <bruno@clisp.org>
+
+       Fix error in C++ mode on glibc systems (regression 2022-04-28).
+       * lib/string.in.h (rpl_free): Add exception specification like
+       stdlib.in.h does.
+       * lib/wchar.in.h (rpl_free): Likewise.
+
 2023-02-09  Bruno Haible  <bruno@clisp.org>
 
        getcwd: Fix compilation error in C23 mode.
index 0fe4a5e1f82d4da8c6928961a861bdd78729ed47..cac982ee25ad8852a907ac9b0d10a05268efa708 100644 (file)
 # if (@REPLACE_FREE@ && !defined free \
       && !(defined __cplusplus && defined GNULIB_NAMESPACE))
 /* We can't do '#define free rpl_free' here.  */
+#  if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2)
+_GL_EXTERN_C void rpl_free (void *) throw ();
+#  else
 _GL_EXTERN_C void rpl_free (void *);
+#  endif
 #  undef _GL_ATTRIBUTE_DEALLOC_FREE
 #  define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (rpl_free, 1)
 # else
index 70b8d7d259a54be1b50d77770ae5b15d1b093b0d..6b4981a49a32640ddfcd8e3e376b426891e82229 100644 (file)
@@ -188,7 +188,11 @@ typedef int rpl_mbstate_t;
 # if (@REPLACE_FREE@ && !defined free \
       && !(defined __cplusplus && defined GNULIB_NAMESPACE))
 /* We can't do '#define free rpl_free' here.  */
+#  if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2)
+_GL_EXTERN_C void rpl_free (void *) throw ();
+#  else
 _GL_EXTERN_C void rpl_free (void *);
+#  endif
 #  undef _GL_ATTRIBUTE_DEALLOC_FREE
 #  define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (rpl_free, 1)
 # else