]> 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>
Thu, 9 Feb 2023 12:16:31 +0000 (13:16 +0100)
* lib/malloc.in.h (rpl_free): Add exception specification like
stdlib.in.h does.
* lib/string.in.h (rpl_free): Likewise.
* lib/wchar.in.h (rpl_free): Likewise.

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

index f9b21e5c42bdcb95a4a0de591b2a7f3aab00ce17..2bbb71a3eeaeddac544a1e3b47f2510ac46d402a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2023-02-09  Bruno Haible  <bruno@clisp.org>
+
+       Fix error in C++ mode on glibc systems (regression 2022-04-28).
+       * lib/malloc.in.h (rpl_free): Add exception specification like
+       stdlib.in.h does.
+       * lib/string.in.h (rpl_free): Likewise.
+       * lib/wchar.in.h (rpl_free): Likewise.
+
 2023-02-09  Bruno Haible  <bruno@clisp.org>
 
        getcwd: Fix compilation error in C23 mode.
index 4921f6e994739c382ee4f811c9131fa502cc8c5b..2fcbe235356b3ba09dcd47f7760cdb9c5c2fdeb6 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 aa088213927463075ed4085e2e5ad9a79b132532..b6bf432e1f1cd32ffd0cdf5a302203a4c81b8914 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 bbca92797d09561210a5f79ccf4d729f7a0bacd4..2beddd780ff11119c898885b807549282583daff 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