From: Bruno Haible <bruno@clisp.org>
Date: Sun, 22 Jan 2023 01:00:51 +0000 (+0100)
Subject: Resolve conflicts for functions introduced in Android API level 16.
X-Git-Tag: v1.0~1780
X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=df12be387c61fa8816c5e7a1b1a435f6e2ce255c;p=gnulib.git

Resolve conflicts for functions introduced in Android API level 16.

* m4/faccessat.m4 (gl_FUNC_FACCESSAT): Conditionally set
REPLACE_FACCESSAT.
* lib/unistd.in.h (faccessat): Disable _GL_CXXALIASWARN invocation on
non-glibc systems.
---

diff --git a/ChangeLog b/ChangeLog
index e711c34b6c..7283803817 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2023-01-22  Bruno Haible  <bruno@clisp.org>
+
+	Resolve conflicts for functions introduced in Android API level 16.
+
+	* m4/faccessat.m4 (gl_FUNC_FACCESSAT): Conditionally set
+	REPLACE_FACCESSAT.
+	* lib/unistd.in.h (faccessat): Disable _GL_CXXALIASWARN invocation on
+	non-glibc systems.
+
 2023-01-22  Bruno Haible  <bruno@clisp.org>
 
 	Resolve conflicts for functions introduced in Android API level 12.
diff --git a/lib/unistd.in.h b/lib/unistd.in.h
index bc69194fac..df095ba479 100644
--- a/lib/unistd.in.h
+++ b/lib/unistd.in.h
@@ -925,7 +925,9 @@ _GL_FUNCDECL_SYS (faccessat, int,
 _GL_CXXALIAS_SYS (faccessat, int,
                   (int fd, char const *file, int mode, int flag));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (faccessat);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef faccessat
 # if HAVE_RAW_DECL_FACCESSAT
diff --git a/m4/faccessat.m4 b/m4/faccessat.m4
index 958c4978b7..a858bfee33 100644
--- a/m4/faccessat.m4
+++ b/m4/faccessat.m4
@@ -1,4 +1,4 @@
-# serial 11
+# serial 12
 # See if we need to provide faccessat replacement.
 
 dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
@@ -19,6 +19,9 @@ AC_DEFUN([gl_FUNC_FACCESSAT],
   gl_CHECK_FUNCS_ANDROID([faccessat], [[#include <unistd.h>]])
   if test $ac_cv_func_faccessat = no; then
     HAVE_FACCESSAT=0
+    case "$gl_cv_onwards_func_faccessat" in
+      future*) REPLACE_FACCESSAT=1 ;;
+    esac
   else
     case $gl_cv_func_lstat_dereferences_slashed_symlink in
       *yes) ;;