From d6a07b4dc21b3118727743142c678858df442853 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Fri, 29 Apr 2022 01:47:55 +0200 Subject: [PATCH] stdlib: Fix error in C++ mode on glibc systems (regr. 2022-04-13). * lib/stdlib.in.h (free): Add exception specification like glibc does. --- ChangeLog | 5 +++++ lib/stdlib.in.h | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index f111e479bf..b5e1a04986 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2022-04-28 Simon Marchi (tiny change) + + stdlib: Fix error in C++ mode on glibc systems (regr. 2022-04-13). + * lib/stdlib.in.h (free): Add exception specification like glibc does. + 2022-04-28 Paul Eggert glob: improve config and test cleanup diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h index d52c2f7963..a86643c3ca 100644 --- a/lib/stdlib.in.h +++ b/lib/stdlib.in.h @@ -184,7 +184,11 @@ _GL_WARN_ON_USE (_Exit, "_Exit is unportable - " # undef free # define free rpl_free # endif +# if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2) +_GL_FUNCDECL_RPL (free, void, (void *ptr) throw ()); +# else _GL_FUNCDECL_RPL (free, void, (void *ptr)); +# endif _GL_CXXALIAS_RPL (free, void, (void *ptr)); # else _GL_CXXALIAS_SYS (free, void, (void *ptr)); -- 2.39.5