>From eaf067b33e6883af540f72340400eabd9f79c029 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 22 Jan 2023 14:09:49 +0100 Subject: [PATCH 32/47] Resolve conflicts for functions introduced in Android API level 23. * m4/error_h.m4 (gl_ERROR_H): Conditionally set REPLACE_ERROR. * lib/error.in.h (error): Disable _GL_CXXALIASWARN invocation on non-glibc systems. --- ChangeLog | 4 ++++ lib/error.in.h | 2 ++ m4/error_h.m4 | 8 ++++++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3f429d5afc..496db94438 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,10 @@ Resolve conflicts for functions introduced in Android API level 23. + * m4/error_h.m4 (gl_ERROR_H): Conditionally set REPLACE_ERROR. + * lib/error.in.h (error): Disable _GL_CXXALIASWARN invocation on + non-glibc systems. + * lib/wchar.in.h (wmempcpy): Consider REPLACE_WMEMPCPY. * m4/wchar_h.m4 (gl_WCHAR_H_DEFAULTS): Initialize REPLACE_WMEMPCPY. * modules/wchar (Makefile.am): Substitute REPLACE_WMEMPCPY. diff --git a/lib/error.in.h b/lib/error.in.h index 2ac99c2817..bfddb011c0 100644 --- a/lib/error.in.h +++ b/lib/error.in.h @@ -56,7 +56,9 @@ _GL_FUNCDECL_SYS (error, void, _GL_CXXALIAS_SYS (error, void, (int __status, int __errnum, const char *__format, ...)); #endif +#if __GLIBC__ >= 2 _GL_CXXALIASWARN (error); +#endif /* Likewise. If FILENAME is non-NULL, include FILENAME:LINENO: in the message. */ diff --git a/m4/error_h.m4 b/m4/error_h.m4 index bb8f68ff81..15b5112309 100644 --- a/m4/error_h.m4 +++ b/m4/error_h.m4 @@ -1,4 +1,4 @@ -# error_h.m4 serial 1 +# error_h.m4 serial 2 dnl Copyright (C) 1996-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -11,13 +11,17 @@ AC_DEFUN_ONCE([gl_ERROR_H], [ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + REPLACE_ERROR=0 + gl_CHECK_FUNCS_ANDROID([error], [[#include ]]) if test $ac_cv_func_error = yes; then HAVE_ERROR=1 else HAVE_ERROR=0 + case "$gl_cv_onwards_func_error" in + future*) REPLACE_ERROR=1 ;; + esac fi - REPLACE_ERROR=0 dnl We don't use AC_FUNC_ERROR_AT_LINE any more, because it is no longer dnl maintained in Autoconf and because it invokes AC_LIBOBJ. -- 2.34.1