]> 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 02:43:18 +0000 (03:43 +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 d7a8a329cc0b0b375fbbc1b8197b28d64b2dbf48..e4c1814a4d814462e843b4038d59b6112638e262 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 e993b2fb6fc64b348993caf2c870f8ac55d8e422..2169af537d8026be822fe8ae9f4b1a7c3ce67a51 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 09c9185f623f2af575a63de5d3c0f1b4f85ba480..c08bca895a1c9e578ee6a687b63e7ba2a831fe47 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