From baaa0ab3fce8a02dc139316a22bc6cb6549bbaaa Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 4 Sep 2022 02:52:14 +0200 Subject: [PATCH] Fix a compilation error in C++ mode on Solaris 11.4. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * lib/uchar.in.h (c32rtomb): Enable the C++ alias warning only on glibc ≥ 2.16 systems. Fix a GNULIB_POSIXCHECK mistake. (mbrtoc32): Enable the C++ alias warning only on glibc ≥ 2.16 systems. --- ChangeLog | 7 +++++++ lib/uchar.in.h | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b5f51a1a0c..332d7443fd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2022-09-03 Bruno Haible + + Fix a compilation error in C++ mode on Solaris 11.4. + * lib/uchar.in.h (c32rtomb): Enable the C++ alias warning only on + glibc ≥ 2.16 systems. Fix a GNULIB_POSIXCHECK mistake. + (mbrtoc32): Enable the C++ alias warning only on glibc ≥ 2.16 systems. + 2022-09-03 Bruno Haible Fix compilation errors of C++ tests on Solaris 10 with Sun C++. diff --git a/lib/uchar.in.h b/lib/uchar.in.h index 13913a3dad..e6a5cddf86 100644 --- a/lib/uchar.in.h +++ b/lib/uchar.in.h @@ -170,11 +170,13 @@ _GL_FUNCDECL_SYS (c32rtomb, size_t, (char *s, char32_t wc, mbstate_t *ps)); # endif _GL_CXXALIAS_SYS (c32rtomb, size_t, (char *s, char32_t wc, mbstate_t *ps)); # endif +# if __GLIBC__ + (__GLIBC_MINOR__ >= 16) > 2 _GL_CXXALIASWARN (c32rtomb); +# endif #elif defined GNULIB_POSIXCHECK # undef c32rtomb # if HAVE_RAW_DECL_C32RTOMB -_GL_WARN_ON_USE (mbrtoc32, "c32rtomb is not portable - " +_GL_WARN_ON_USE (c32rtomb, "c32rtomb is not portable - " "use gnulib module c32rtomb for portability"); # endif #endif @@ -245,7 +247,9 @@ _GL_FUNCDECL_SYS (mbrtoc32, size_t, _GL_CXXALIAS_SYS (mbrtoc32, size_t, (char32_t *pc, const char *s, size_t n, mbstate_t *ps)); # endif +# if __GLIBC__ + (__GLIBC_MINOR__ >= 16) > 2 _GL_CXXALIASWARN (mbrtoc32); +# endif #elif defined GNULIB_POSIXCHECK # undef mbrtoc32 # if HAVE_RAW_DECL_MBRTOC32 -- 2.39.5