From: Bruno Haible Date: Sun, 22 Jan 2023 00:19:44 +0000 (+0100) Subject: Resolve conflicts for functions introduced in Android API level 8. X-Git-Tag: v1.0~1787 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=f4b72fccdb381da20f75fda804b37ecb954c8a42;p=gnulib.git Resolve conflicts for functions introduced in Android API level 8. * m4/ttyname_r.m4 (gl_FUNC_TTYNAME_R): Conditionally set REPLACE_TTYNAME_R. * lib/unistd.in.h (ttyname_r): Disable _GL_CXXALIASWARN invocation on non-glibc systems. --- diff --git a/ChangeLog b/ChangeLog index 83b5e5dd58..a491d5ab6f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2023-01-22 Bruno Haible + + Resolve conflicts for functions introduced in Android API level 8. + * m4/ttyname_r.m4 (gl_FUNC_TTYNAME_R): Conditionally set + REPLACE_TTYNAME_R. + * lib/unistd.in.h (ttyname_r): Disable _GL_CXXALIASWARN invocation on + non-glibc systems. + 2023-01-22 Bruno Haible Prepare for resolving conflicts regarding future Android API levels. diff --git a/lib/unistd.in.h b/lib/unistd.in.h index 4812fdb112..f6d7c8d0a9 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -2173,7 +2173,9 @@ _GL_FUNCDECL_SYS (ttyname_r, int, _GL_CXXALIAS_SYS (ttyname_r, int, (int fd, char *buf, size_t buflen)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (ttyname_r); +# endif #elif defined GNULIB_POSIXCHECK # undef ttyname_r # if HAVE_RAW_DECL_TTYNAME_R diff --git a/m4/ttyname_r.m4 b/m4/ttyname_r.m4 index 4a76155469..60aa357c25 100644 --- a/m4/ttyname_r.m4 +++ b/m4/ttyname_r.m4 @@ -1,4 +1,4 @@ -# ttyname_r.m4 serial 12 +# ttyname_r.m4 serial 13 dnl Copyright (C) 2010-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, @@ -20,6 +20,9 @@ AC_DEFUN([gl_FUNC_TTYNAME_R], gl_CHECK_FUNCS_ANDROID([ttyname_r], [[#include ]]) if test $ac_cv_func_ttyname_r = no; then HAVE_TTYNAME_R=0 + case "$gl_cv_onwards_func_ttyname_r" in + future*) REPLACE_TTYNAME_R=1 ;; + esac else HAVE_TTYNAME_R=1 dnl On Mac OS X 10.4 (and Solaris 10 without gl_USE_SYSTEM_EXTENSIONS)