>From 3056396bd90cf910aa761a25be735ef0327f6516 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 22 Jan 2023 14:43:32 +0100 Subject: [PATCH 43/47] Resolve conflicts for functions introduced in Android API level 28. * m4/getlogin_r.m4 (gl_FUNC_GETLOGIN_R): Conditionally set REPLACE_GETLOGIN_R. * lib/unistd.in.h (getlogin_r): Disable _GL_CXXALIASWARN invocation on non-glibc systems. --- ChangeLog | 5 +++++ lib/unistd.in.h | 2 ++ m4/getlogin_r.m4 | 5 ++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5d85124904..5d89546b44 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,11 @@ Resolve conflicts for functions introduced in Android API level 28. + * m4/getlogin_r.m4 (gl_FUNC_GETLOGIN_R): Conditionally set + REPLACE_GETLOGIN_R. + * lib/unistd.in.h (getlogin_r): Disable _GL_CXXALIASWARN invocation on + non-glibc systems. + * m4/spawn_h.m4 (gl_HAVE_POSIX_SPAWN): Conditionally set REPLACE_POSIX_SPAWN. * lib/spawn.in.h: Adapt logic for defining the POSIX_SPAWN_* constants. diff --git a/lib/unistd.in.h b/lib/unistd.in.h index 8016f7345e..bfc501e5a7 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -1356,7 +1356,9 @@ _GL_FUNCDECL_SYS (getlogin_r, int, (char *name, size_t size) int size. */ _GL_CXXALIAS_SYS_CAST (getlogin_r, int, (char *name, size_t size)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (getlogin_r); +# endif #elif defined GNULIB_POSIXCHECK # undef getlogin_r # if HAVE_RAW_DECL_GETLOGIN_R diff --git a/m4/getlogin_r.m4 b/m4/getlogin_r.m4 index cbfe255ee1..4383ea6a02 100644 --- a/m4/getlogin_r.m4 +++ b/m4/getlogin_r.m4 @@ -1,4 +1,4 @@ -#serial 14 +#serial 15 # Copyright (C) 2005-2007, 2009-2023 Free Software Foundation, Inc. # @@ -28,6 +28,9 @@ AC_DEFUN([gl_FUNC_GETLOGIN_R], gl_CHECK_FUNCS_ANDROID([getlogin_r], [[#include ]]) if test $ac_cv_func_getlogin_r = no; then HAVE_GETLOGIN_R=0 + case "$gl_cv_onwards_func_getlogin_r" in + future*) REPLACE_GETLOGIN_R=1 ;; + esac else HAVE_GETLOGIN_R=1 dnl On Mac OS X 10.13 and OSF/1 5.1, getlogin_r returns a truncated result -- 2.34.1