From 88f028169f45de608acced0a4667bcbb347ff348 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 2 Sep 2022 20:34:44 +0200 Subject: [PATCH] strtol, strtoul: Fix compilation error in C++ mode on Solaris 11. * lib/stdlib.in.h (strtol, strtoul): Enable the C++ alias warning only on glibc systems. --- ChangeLog | 6 ++++++ lib/stdlib.in.h | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index 7896b9d31f..27fce28d8d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2022-09-02 Bruno Haible + + strtol, strtoul: Fix compilation error in C++ mode on Solaris 11. + * lib/stdlib.in.h (strtol, strtoul): Enable the C++ alias warning only + on glibc systems. + 2022-09-02 Bruno Haible aligned_alloc: Fix compilation error in C++ mode on Solaris 11. diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h index 010875803c..8e0a609f1f 100644 --- a/lib/stdlib.in.h +++ b/lib/stdlib.in.h @@ -1363,7 +1363,9 @@ _GL_CXXALIAS_SYS (strtol, long, (const char *restrict string, char **restrict endptr, int base)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (strtol); +# endif #elif defined GNULIB_POSIXCHECK # undef strtol # if HAVE_RAW_DECL_STRTOL @@ -1444,7 +1446,9 @@ _GL_CXXALIAS_SYS (strtoul, unsigned long, (const char *restrict string, char **restrict endptr, int base)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (strtoul); +# endif #elif defined GNULIB_POSIXCHECK # undef strtoul # if HAVE_RAW_DECL_STRTOUL -- 2.39.5