From: Bruno Haible Date: Thu, 5 Jan 2023 16:16:09 +0000 (+0100) Subject: getpass: Fix compilation error on Android. X-Git-Tag: v1.0~1901 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=7ca7d7d7d7553f9d6f3484e53f24d10433f8fdcd;p=gnulib.git getpass: Fix compilation error on Android. * m4/getpass.m4 (gl_FUNC_GETPASS): Define NO_INLINE_GETPASS. * doc/glibc-functions/getpass.texi: Mention the Android problem. --- diff --git a/ChangeLog b/ChangeLog index 7327d57a4c..71a4dd1acf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2023-01-05 Bruno Haible + + getpass: Fix compilation error on Android. + * m4/getpass.m4 (gl_FUNC_GETPASS): Define NO_INLINE_GETPASS. + * doc/glibc-functions/getpass.texi: Mention the Android problem. + 2023-01-05 Bruno Haible Recognize functions added in future versions of Android. diff --git a/doc/glibc-functions/getpass.texi b/doc/glibc-functions/getpass.texi index 17f1b2374b..8d2ff847ee 100644 --- a/doc/glibc-functions/getpass.texi +++ b/doc/glibc-functions/getpass.texi @@ -22,6 +22,10 @@ Portability problems fixed by either Gnulib module @code{getpass} or @code{getpa @item This function is missing on some platforms: mingw, MSVC 14, Android 9.0. +@item +This function cannot be called from plain inline or extern inline functions +on some platforms: +Android 13. @end itemize Portability problems fixed by Gnulib module @code{getpass-gnu}: diff --git a/m4/getpass.m4 b/m4/getpass.m4 index 15882712d9..2dce1e0dfe 100644 --- a/m4/getpass.m4 +++ b/m4/getpass.m4 @@ -1,4 +1,4 @@ -# getpass.m4 serial 17 +# getpass.m4 serial 18 dnl Copyright (C) 2002-2003, 2005-2006, 2009-2023 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation @@ -13,6 +13,9 @@ AC_DEFUN_ONCE([gl_FUNC_GETPASS], dnl Persuade Solaris and to declare getpass(). AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + dnl Persuade Android to not define getpass() as an inline function. + AC_DEFINE([NO_INLINE_GETPASS], [1], [Define to 1 on Android.]) + AC_CHECK_FUNCS_ONCE([getpass]) if test $ac_cv_func_getpass = no; then HAVE_GETPASS=0