]> Savannah Git Hosting - gnulib.git/commitdiff
Resolve conflicts for functions introduced in Android API level 21.
authorBruno Haible <bruno@clisp.org>
Sun, 22 Jan 2023 11:34:17 +0000 (12:34 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 22 Jan 2023 14:56:44 +0000 (15:56 +0100)
* m4/execvpe.m4 (gl_FUNC_EXECVPE): Conditionally set REPLACE_EXECVPE.
* m4/linkat.m4 (gl_FUNC_LINKAT): Conditionally set REPLACE_LINKAT.
* m4/readlinkat.m4 (gl_FUNC_READLINKAT): Conditionally set
REPLACE_READLINKAT.
* m4/symlinkat.m4 (gl_FUNC_SYMLINKAT): Conditionally set
REPLACE_SYMLINKAT.
* m4/truncate.m4 (gl_FUNC_TRUNCATE): Conditionally set REPLACE_TRUNCATE.
* lib/unistd.in.h (execvpe, linkat, readlinkat, symlinkat, truncate):
Disable _GL_CXXALIASWARN invocation on non-glibc systems.

ChangeLog
lib/unistd.in.h
m4/execvpe.m4
m4/linkat.m4
m4/readlinkat.m4
m4/symlinkat.m4
m4/truncate.m4

index 33b820b8889317a4379edb1a3588a71e188472e7..5479a8685e84a8512a4b150da4ca2d491cc439a1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,16 @@
 
        Resolve conflicts for functions introduced in Android API level 21.
 
+       * m4/execvpe.m4 (gl_FUNC_EXECVPE): Conditionally set REPLACE_EXECVPE.
+       * m4/linkat.m4 (gl_FUNC_LINKAT): Conditionally set REPLACE_LINKAT.
+       * m4/readlinkat.m4 (gl_FUNC_READLINKAT): Conditionally set
+       REPLACE_READLINKAT.
+       * m4/symlinkat.m4 (gl_FUNC_SYMLINKAT): Conditionally set
+       REPLACE_SYMLINKAT.
+       * m4/truncate.m4 (gl_FUNC_TRUNCATE): Conditionally set REPLACE_TRUNCATE.
+       * lib/unistd.in.h (execvpe, linkat, readlinkat, symlinkat, truncate):
+       Disable _GL_CXXALIASWARN invocation on non-glibc systems.
+
        * m4/mkfifoat.m4 (gl_FUNC_MKFIFOAT): Conditionally set REPLACE_MKNODAT.
        * lib/sys_stat.in.h (mknodat): Disable _GL_CXXALIASWARN invocation on
        non-glibc systems.
index 345b73945a2c8672fcac1b630aec7f1b595a5156..2a6d4ce743bb47b87a19d7248fe04eba29677395 100644 (file)
@@ -875,7 +875,9 @@ _GL_FUNCDECL_SYS (execvpe, int,
 _GL_CXXALIAS_SYS (execvpe, int,
                   (const char *program, char * const *argv, char * const *env));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (execvpe);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef execvpe
 # if HAVE_RAW_DECL_EXECVPE
@@ -1681,7 +1683,9 @@ _GL_CXXALIAS_SYS (linkat, int,
                   (int fd1, const char *path1, int fd2, const char *path2,
                    int flag));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (linkat);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef linkat
 # if HAVE_RAW_DECL_LINKAT
@@ -1963,7 +1967,9 @@ _GL_CXXALIAS_SYS (readlinkat, ssize_t,
                   (int fd, char const *restrict file,
                    char *restrict buf, size_t len));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (readlinkat);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef readlinkat
 # if HAVE_RAW_DECL_READLINKAT
@@ -2140,7 +2146,9 @@ _GL_FUNCDECL_SYS (symlinkat, int,
 _GL_CXXALIAS_SYS (symlinkat, int,
                   (char const *contents, int fd, char const *file));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (symlinkat);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef symlinkat
 # if HAVE_RAW_DECL_SYMLINKAT
@@ -2170,7 +2178,9 @@ _GL_FUNCDECL_SYS (truncate, int, (const char *filename, off_t length)
 #  endif
 _GL_CXXALIAS_SYS (truncate, int, (const char *filename, off_t length));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (truncate);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef truncate
 # if HAVE_RAW_DECL_TRUNCATE
index 6c0a0e9b7d5f66d2ed65a78d0e0b94adf53a56f3..3f211049b8992684f3105d85c6e5e6a39c3ef69e 100644 (file)
@@ -1,4 +1,4 @@
-# execvpe.m4 serial 2
+# execvpe.m4 serial 3
 dnl Copyright (C) 2020-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,
@@ -18,6 +18,9 @@ AC_DEFUN([gl_FUNC_EXECVPE],
       gl_CHECK_FUNCS_ANDROID([execvpe], [[#include <unistd.h>]])
       if test $ac_cv_func_execvpe != yes; then
         HAVE_EXECVPE=0
+        case "$gl_cv_onwards_func_execvpe" in
+          future*) REPLACE_EXECVPE=1 ;;
+        esac
       fi
       ;;
   esac
index 9b35fc14e3bd5b321a0b5b2721261a16458c7de5..032e89bb545dddb70bb3c01e2e34187a03cac572 100644 (file)
@@ -1,4 +1,4 @@
-# serial 15
+# serial 16
 # See if we need to provide linkat replacement.
 
 dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
@@ -19,6 +19,9 @@ AC_DEFUN([gl_FUNC_LINKAT],
   gl_CHECK_FUNCS_ANDROID([linkat], [[#include <unistd.h>]])
   if test $ac_cv_func_linkat = no; then
     HAVE_LINKAT=0
+    case "$gl_cv_onwards_func_linkat" in
+      future*) REPLACE_LINKAT=1 ;;
+    esac
   else
     dnl OS X Yosemite has linkat() but it's not sufficient
     dnl to our needs since it doesn't support creating
index 416f9c0d6402e9e21234dfc79ff2d55098eea5b9..5c513562919ee2ad02d87a35b89227ab153143de 100644 (file)
@@ -1,4 +1,4 @@
-# serial 7
+# serial 8
 # See if we need to provide readlinkat replacement.
 
 dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
@@ -16,6 +16,9 @@ AC_DEFUN([gl_FUNC_READLINKAT],
   AC_REQUIRE([gl_FUNC_READLINK])
   if test $ac_cv_func_readlinkat = no; then
     HAVE_READLINKAT=0
+    case "$gl_cv_onwards_func_readlinkat" in
+      future*) REPLACE_READLINKAT=1 ;;
+    esac
   else
     AC_CACHE_CHECK([whether readlinkat signature is correct],
       [gl_cv_decl_readlinkat_works],
index d12f91997c6a53ed5c4d9db024467a2787aa4b93..dc3dd323aaabbae53c2fef739d51b0dd644a11ec 100644 (file)
@@ -1,4 +1,4 @@
-# serial 11
+# serial 12
 # See if we need to provide symlinkat replacement.
 
 dnl Copyright (C) 2009-2023 Free Software Foundation, Inc.
@@ -17,6 +17,9 @@ AC_DEFUN([gl_FUNC_SYMLINKAT],
   gl_CHECK_FUNCS_ANDROID([symlinkat], [[#include <unistd.h>]])
   if test $ac_cv_func_symlinkat = no; then
     HAVE_SYMLINKAT=0
+    case "$gl_cv_onwards_func_symlinkat" in
+      future*) REPLACE_SYMLINKAT=1 ;;
+    esac
   else
     AC_CACHE_CHECK([whether symlinkat handles trailing slash correctly],
       [gl_cv_func_symlinkat_works],
index b047af34c98d9cca3f2dbc46d29f0f554fd13c9d..fe9fdbf4086a4b18f62f50a84344c5c516e0d575 100644 (file)
@@ -1,4 +1,4 @@
-# truncate.m4 serial 4   -*- Autoconf -*-
+# truncate.m4 serial 5   -*- Autoconf -*-
 dnl Copyright (C) 2017-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,
@@ -71,10 +71,10 @@ AC_DEFUN([gl_FUNC_TRUNCATE],
     fi
   else
     HAVE_DECL_TRUNCATE=0
-    if test $ac_cv_func_truncate = yes; then
+    case "$gl_cv_onwards_func_truncate" in
       dnl Avoid a conflict with the 'truncate' in libc.
-      REPLACE_TRUNCATE=1
-    fi
+      yes | future*) REPLACE_TRUNCATE=1 ;;
+    esac
   fi
 ])