diff options
author | Bruno Haible <bruno@clisp.org> | 2023-01-22 14:22:28 +0100 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2023-01-22 15:57:18 +0100 |
commit | 39eda5d0b1b3d1df691102b311868ef4ce69d221 (patch) | |
tree | 656b04c15b8ca6f7c2d7fa567f0725d024d0c445 /lib | |
parent | a1e2c8310d3694d3a80201ea63371e33a58d2d2a (diff) | |
download | gnulib-39eda5d0b1b3d1df691102b311868ef4ce69d221.tar.gz |
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.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/unistd.in.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/unistd.in.h b/lib/unistd.in.h index 9930a11c19..8016f7345e 100644 --- a/lib/unistd.in.h +++ b/lib/unistd.in.h @@ -1207,11 +1207,22 @@ _GL_WARN_ON_USE (getdtablesize, "getdtablesize is unportable - " #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 |