From: Bruno Haible Date: Thu, 20 Mar 2025 16:35:38 +0000 (+0100) Subject: Fix compilation errors in C++ mode on Android. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=6f353754751e2cdeab6a989e12e75da4cd9ec29d;p=gnulib.git Fix compilation errors in C++ mode on Android. * lib/string.in.h (memset_explicit, strerrorname_np): Disable _GL_CXXALIASWARN invocation on non-glibc systems. * lib/time.in.h (timespec_getres): Likewise. * lib/unistd.in.h (copy_file_range): Likewise. --- diff --git a/ChangeLog b/ChangeLog index 44a186dea1..77e0a4ca2b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2025-03-20 Bruno Haible + + Fix compilation errors in C++ mode on Android. + * lib/string.in.h (memset_explicit, strerrorname_np): Disable + _GL_CXXALIASWARN invocation on non-glibc systems. + * lib/time.in.h (timespec_getres): Likewise. + * lib/unistd.in.h (copy_file_range): Likewise. + 2025-03-18 Collin Funk futimens: Work around a GNU/Hurd bug. diff --git a/lib/string.in.h b/lib/string.in.h index 03ab36335b..30b268c43a 100644 --- a/lib/string.in.h +++ b/lib/string.in.h @@ -1,6 +1,6 @@ /* A GNU-like . - Copyright (C) 1995-1996, 2001-2024 Free Software Foundation, Inc. + Copyright (C) 1995-1996, 2001-2025 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -429,7 +429,9 @@ _GL_FUNCDECL_SYS (memset_explicit, void *, # endif _GL_CXXALIAS_SYS (memset_explicit, void *, (void *__dest, int __c, size_t __n)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (memset_explicit); +# endif #elif defined GNULIB_POSIXCHECK # undef memset_explicit # if HAVE_RAW_DECL_MEMSET_EXPLICIT @@ -1367,7 +1369,9 @@ _GL_FUNCDECL_SYS (strerrorname_np, const char *, (int errnum)); # endif _GL_CXXALIAS_SYS (strerrorname_np, const char *, (int errnum)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (strerrorname_np); +# endif #elif defined GNULIB_POSIXCHECK # undef strerrorname_np # if HAVE_RAW_DECL_STRERRORNAME_NP diff --git a/lib/time.in.h b/lib/time.in.h index f4829ffe2f..ac1832b43b 100644 --- a/lib/time.in.h +++ b/lib/time.in.h @@ -1,6 +1,6 @@ /* A more-standard . - Copyright (C) 2007-2024 Free Software Foundation, Inc. + Copyright (C) 2007-2025 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -186,7 +186,9 @@ _GL_FUNCDECL_SYS (timespec_getres, int, (struct timespec *ts, int base) # endif _GL_CXXALIAS_SYS (timespec_getres, int, (struct timespec *ts, int base)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (timespec_getres); +# endif # elif defined GNULIB_POSIXCHECK # undef timespec_getres # if HAVE_RAW_DECL_TIMESPEC_GETRES diff --git a/lib/unistd.in.h b/lib/unistd.in.h index 2fc1f14654..9744d28443 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -1,5 +1,5 @@ /* Substitute for and wrapper around . - Copyright (C) 2003-2024 Free Software Foundation, Inc. + Copyright (C) 2003-2025 Free Software Foundation, Inc. This file is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as @@ -463,7 +463,9 @@ _GL_CXXALIAS_SYS (copy_file_range, ssize_t, (int ifd, off_t *ipos, int ofd, off_t *opos, size_t len, unsigned flags)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (copy_file_range); +# endif #elif defined GNULIB_POSIXCHECK # undef copy_file_range # if HAVE_RAW_DECL_COPY_FILE_RANGE