From 7d2fc0f518407f69846a4c58cd775689b3465bc6 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 22 Jan 2023 01:46:21 +0100 Subject: [PATCH 08/47] Resolve conflicts for functions introduced in Android API level 12. * m4/utimensat.m4 (gl_FUNC_UTIMENSAT): Conditionally set REPLACE_UTIMENSAT. * lib/sys_stat.in.h (utimensat): Disable _GL_CXXALIASWARN invocation on non-glibc systems. --- ChangeLog | 5 +++++ lib/sys_stat.in.h | 2 +- m4/utimensat.m4 | 5 ++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 069ce89b10..e711c34b6c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,11 @@ Resolve conflicts for functions introduced in Android API level 12. + * m4/utimensat.m4 (gl_FUNC_UTIMENSAT): Conditionally set + REPLACE_UTIMENSAT. + * lib/sys_stat.in.h (utimensat): Disable _GL_CXXALIASWARN invocation on + non-glibc systems. + * m4/timegm.m4 (gl_FUNC_TIMEGM): Conditionally set REPLACE_TIMEGM. * lib/time.in.h (timegm): Disable _GL_CXXALIASWARN invocation on non-glibc systems. diff --git a/lib/sys_stat.in.h b/lib/sys_stat.in.h index 096887c016..915cab08fb 100644 --- a/lib/sys_stat.in.h +++ b/lib/sys_stat.in.h @@ -937,7 +937,7 @@ _GL_FUNCDECL_SYS (utimensat, int, (int fd, char const *name, _GL_CXXALIAS_SYS (utimensat, int, (int fd, char const *name, struct timespec const times[2], int flag)); # endif -# if @HAVE_UTIMENSAT@ +# if __GLIBC__ >= 2 && @HAVE_UTIMENSAT@ _GL_CXXALIASWARN (utimensat); # endif #elif defined GNULIB_POSIXCHECK diff --git a/m4/utimensat.m4 b/m4/utimensat.m4 index 1d3db2efa2..1a670bb7b7 100644 --- a/m4/utimensat.m4 +++ b/m4/utimensat.m4 @@ -1,4 +1,4 @@ -# serial 10 +# serial 11 # See if we need to provide utimensat replacement. dnl Copyright (C) 2009-2023 Free Software Foundation, Inc. @@ -16,6 +16,9 @@ AC_DEFUN([gl_FUNC_UTIMENSAT], gl_CHECK_FUNCS_ANDROID([utimensat], [[#include ]]) if test $ac_cv_func_utimensat = no; then HAVE_UTIMENSAT=0 + case "$gl_cv_onwards_func_utimensat" in + future*) REPLACE_UTIMENSAT=1 ;; + esac else AC_CACHE_CHECK([whether utimensat works], [gl_cv_func_utimensat_works], -- 2.34.1