From ed66fa04f2ee87b4ce378bd238e3477102550673 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 3 Sep 2022 02:48:38 +0200 Subject: [PATCH] getrandom: Fix compilation error in C++ mode on FreeBSD 12. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * lib/sys_random.in.h (getrandom): Enable the C++ alias warning only on glibc ≥ 2.25 systems. --- ChangeLog | 6 ++++++ lib/sys_random.in.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index 020fc099eb..0834c53031 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2022-09-02 Bruno Haible + + getrandom: Fix compilation error in C++ mode on FreeBSD 12. + * lib/sys_random.in.h (getrandom): Enable the C++ alias warning only on + glibc ≥ 2.25 systems. + 2022-09-02 Bruno Haible math C++ tests: Fix compilation error with clang on FreeBSD 13. diff --git a/lib/sys_random.in.h b/lib/sys_random.in.h index e730e6139f..c91bcd2cd0 100644 --- a/lib/sys_random.in.h +++ b/lib/sys_random.in.h @@ -84,7 +84,9 @@ _GL_FUNCDECL_SYS (getrandom, ssize_t, _GL_CXXALIAS_SYS (getrandom, ssize_t, (void *buffer, size_t length, unsigned int flags)); # endif +# if __GLIBC__ + (__GLIBC_MINOR__ >= 25) > 2 _GL_CXXALIASWARN (getrandom); +# endif #elif defined GNULIB_POSIXCHECK # undef getrandom # if HAVE_RAW_DECL_GETRANDOM -- 2.39.5