+2023-01-22 Bruno Haible <bruno@clisp.org>
+
+ Resolve conflicts for functions introduced in Android API level 28.
+
+ * lib/unistd.in.h (getentropy): Consider REPLACE_GETENTROPY. Disable
+ _GL_CXXALIASWARN invocation on non-glibc systems.
+ * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize REPLACE_GETENTROPY.
+ * modules/unistd (Makefile.am): Substitute REPLACE_GETENTROPY.
+ * m4/getentropy.m4 (gl_FUNC_GETENTROPY): Conditionally set
+ REPLACE_GETENTROPY.
+ * modules/getentropy (Depends-on, configure.ac): Consider
+ REPLACE_GETENTROPY.
+
2023-01-22 Bruno Haible <bruno@clisp.org>
Resolve conflicts for functions introduced in Android API level 26.
#if @GNULIB_GETENTROPY@
/* Fill a buffer with random bytes. */
-# if !@HAVE_GETENTROPY@
+# if @REPLACE_GETENTROPY@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getentropy
+# define getentropy rpl_getentropy
+# endif
+_GL_FUNCDECL_RPL (getentropy, int, (void *buffer, size_t length));
+_GL_CXXALIAS_RPL (getentropy, int, (void *buffer, size_t length));
+# else
+# if !@HAVE_GETENTROPY@
_GL_FUNCDECL_SYS (getentropy, int, (void *buffer, size_t length));
-# endif
+# endif
_GL_CXXALIAS_SYS (getentropy, int, (void *buffer, size_t length));
+# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (getentropy);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef getentropy
# if HAVE_RAW_DECL_GETENTROPY
-# getentropy.m4 serial 2
+# getentropy.m4 serial 3
dnl Copyright 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,
]])
if test $ac_cv_func_getentropy = no; then
HAVE_GETENTROPY=0
+ case "$gl_cv_onwards_func_getentropy" in
+ future*) REPLACE_GETENTROPY=1 ;;
+ esac
fi
])
-# unistd_h.m4 serial 93
+# unistd_h.m4 serial 94
dnl Copyright (C) 2006-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,
REPLACE_GETCWD=0; AC_SUBST([REPLACE_GETCWD])
REPLACE_GETDOMAINNAME=0; AC_SUBST([REPLACE_GETDOMAINNAME])
REPLACE_GETDTABLESIZE=0; AC_SUBST([REPLACE_GETDTABLESIZE])
+ REPLACE_GETENTROPY=0; AC_SUBST([REPLACE_GETENTROPY])
REPLACE_GETLOGIN_R=0; AC_SUBST([REPLACE_GETLOGIN_R])
REPLACE_GETGROUPS=0; AC_SUBST([REPLACE_GETGROUPS])
REPLACE_GETPAGESIZE=0; AC_SUBST([REPLACE_GETPAGESIZE])
m4/getentropy.m4
Depends-on:
-getrandom [test $HAVE_GETENTROPY = 0]
+getrandom [test $HAVE_GETENTROPY = 0 || test $REPLACE_GETENTROPY = 1]
extensions
unistd
configure.ac:
gl_FUNC_GETENTROPY
-gl_CONDITIONAL([GL_COND_OBJ_GETENTROPY], [test $HAVE_GETENTROPY = 0])
+gl_CONDITIONAL([GL_COND_OBJ_GETENTROPY],
+ [test $HAVE_GETENTROPY = 0 || test $REPLACE_GETENTROPY = 1])
gl_UNISTD_MODULE_INDICATOR([getentropy])
Makefile.am:
-e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \
-e 's|@''REPLACE_GETDOMAINNAME''@|$(REPLACE_GETDOMAINNAME)|g' \
-e 's|@''REPLACE_GETDTABLESIZE''@|$(REPLACE_GETDTABLESIZE)|g' \
+ -e 's|@''REPLACE_GETENTROPY''@|$(REPLACE_GETENTROPY)|g' \
-e 's|@''REPLACE_GETLOGIN_R''@|$(REPLACE_GETLOGIN_R)|g' \
-e 's|@''REPLACE_GETGROUPS''@|$(REPLACE_GETGROUPS)|g' \
-e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \