From 31617d81c53135e56f943299f54fd26acc3afe79 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 22 Jan 2023 14:16:36 +0100 Subject: Resolve conflicts for functions introduced in Android API level 26. * lib/stdlib.in.h (getsubopt): Consider REPLACE_GETSUBOPT. Disable _GL_CXXALIASWARN invocation on non-glibc systems. * m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Initialize REPLACE_GETSUBOPT. * modules/stdlib (Makefile.am): Substitute REPLACE_GETSUBOPT. * m4/getsubopt.m4 (gl_FUNC_GETSUBOPT): Conditionally set REPLACE_GETSUBOPT. * modules/getsubopt (Depends-on, configure.ac): Consider REPLACE_GETSUBOPT. --- lib/stdlib.in.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/stdlib.in.h b/lib/stdlib.in.h index 95e0b847b9..c03f46ee38 100644 --- a/lib/stdlib.in.h +++ b/lib/stdlib.in.h @@ -488,14 +488,28 @@ _GL_WARN_ON_USE (getprogname, "getprogname is unportable - " Otherwise it returns -1, and *OPTIONP and *VALUEP are undefined. For more details see the POSIX specification. https://pubs.opengroup.org/onlinepubs/9699919799/functions/getsubopt.html */ -# if !@HAVE_GETSUBOPT@ +# if @REPLACE_GETSUBOPT@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef getsubopt +# define getsubopt rpl_getsubopt +# endif +_GL_FUNCDECL_RPL (getsubopt, int, + (char **optionp, char *const *tokens, char **valuep) + _GL_ARG_NONNULL ((1, 2, 3))); +_GL_CXXALIAS_RPL (getsubopt, int, + (char **optionp, char *const *tokens, char **valuep)); +# else +# if !@HAVE_GETSUBOPT@ _GL_FUNCDECL_SYS (getsubopt, int, (char **optionp, char *const *tokens, char **valuep) _GL_ARG_NONNULL ((1, 2, 3))); -# endif +# endif _GL_CXXALIAS_SYS (getsubopt, int, (char **optionp, char *const *tokens, char **valuep)); +# endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (getsubopt); +# endif #elif defined GNULIB_POSIXCHECK # undef getsubopt # if HAVE_RAW_DECL_GETSUBOPT -- cgit v1.2.1