summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2023-01-22 14:16:36 +0100
committerBruno Haible <bruno@clisp.org>2023-01-22 15:57:11 +0100
commit31617d81c53135e56f943299f54fd26acc3afe79 (patch)
treea8e6b88b2394c08693d107ef12bf83c0ed6e5832 /lib
parent98a7c3a0cb97db93cabf376cbef7fbb81d4f4023 (diff)
downloadgnulib-31617d81c53135e56f943299f54fd26acc3afe79.tar.gz
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/stdlib.in.h18
1 files changed, 16 insertions, 2 deletions
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