+2023-01-22 Bruno Haible <bruno@clisp.org>
+
+ Resolve conflicts for functions introduced in Android API level 23.
+
+ * lib/stdlib.in.h (mkostemp): Consider REPLACE_MKOSTEMP. Disable
+ _GL_CXXALIASWARN invocation on non-glibc systems.
+ (mkostemps): Consider REPLACE_MKOSTEMPS. Disable _GL_CXXALIASWARN
+ invocation on non-glibc systems.
+ * m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Initialize REPLACE_MKOSTEMP,
+ REPLACE_MKOSTEMPS.
+ * modules/stdlib (Makefile.am): Substitute REPLACE_MKOSTEMP,
+ REPLACE_MKOSTEMPS.
+ * m4/mkostemp.m4 (gl_FUNC_MKOSTEMP): Conditionally set REPLACE_MKOSTEMP.
+ * modules/mkostemp (Depends-on, configure.ac): Consider
+ REPLACE_MKOSTEMP.
+ * m4/mkostemps.m4 (gl_FUNC_MKOSTEMPS): Conditionally set
+ REPLACE_MKOSTEMPS.
+ * modules/mkostemps (Depends-on, configure.ac): Consider
+ REPLACE_MKOSTEMPS.
+
2023-01-22 Bruno Haible <bruno@clisp.org>
Resolve conflicts for functions introduced in Android API level 21.
implementation.
Returns the open file descriptor if successful, otherwise -1 and errno
set. */
-# if !@HAVE_MKOSTEMP@
+# if @REPLACE_MKOSTEMP@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef mkostemp
+# define mkostemp rpl_mkostemp
+# endif
+_GL_FUNCDECL_RPL (mkostemp, int, (char * /*template*/, int /*flags*/)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (mkostemp, int, (char * /*template*/, int /*flags*/));
+# else
+# if !@HAVE_MKOSTEMP@
_GL_FUNCDECL_SYS (mkostemp, int, (char * /*template*/, int /*flags*/)
_GL_ARG_NONNULL ((1)));
-# endif
+# endif
_GL_CXXALIAS_SYS (mkostemp, int, (char * /*template*/, int /*flags*/));
+# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (mkostemp);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef mkostemp
# if HAVE_RAW_DECL_MKOSTEMP
implementation.
Returns the open file descriptor if successful, otherwise -1 and errno
set. */
-# if !@HAVE_MKOSTEMPS@
+# if @REPLACE_MKOSTEMPS@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef mkostemps
+# define mkostemps rpl_mkostemps
+# endif
+_GL_FUNCDECL_RPL (mkostemps, int,
+ (char * /*template*/, int /*suffixlen*/, int /*flags*/)
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (mkostemps, int,
+ (char * /*template*/, int /*suffixlen*/, int /*flags*/));
+# else
+# if !@HAVE_MKOSTEMPS@
_GL_FUNCDECL_SYS (mkostemps, int,
(char * /*template*/, int /*suffixlen*/, int /*flags*/)
_GL_ARG_NONNULL ((1)));
-# endif
+# endif
_GL_CXXALIAS_SYS (mkostemps, int,
(char * /*template*/, int /*suffixlen*/, int /*flags*/));
+# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (mkostemps);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef mkostemps
# if HAVE_RAW_DECL_MKOSTEMPS
-# mkostemp.m4 serial 3
+# mkostemp.m4 serial 4
dnl Copyright (C) 2009-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,
gl_CHECK_FUNCS_ANDROID([mkostemp], [[#include <stdlib.h>]])
if test $ac_cv_func_mkostemp != yes; then
HAVE_MKOSTEMP=0
+ case "$gl_cv_onwards_func_mkostemp" in
+ future*) REPLACE_MKOSTEMP=1 ;;
+ esac
fi
])
-# mkostemps.m4 serial 3
+# mkostemps.m4 serial 4
dnl Copyright (C) 2009-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,
gl_CHECK_FUNCS_ANDROID([mkostemps], [[#include <stdlib.h>]])
if test $ac_cv_func_mkostemps != yes; then
HAVE_MKOSTEMPS=0
+ case "$gl_cv_onwards_func_mkostemps" in
+ future*) REPLACE_MKOSTEMPS=1 ;;
+ esac
fi
])
-# stdlib_h.m4 serial 68
+# stdlib_h.m4 serial 69
dnl Copyright (C) 2007-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_MALLOC_FOR_MALLOC_GNU=0; AC_SUBST([REPLACE_MALLOC_FOR_MALLOC_GNU])
REPLACE_MALLOC_FOR_MALLOC_POSIX=0; AC_SUBST([REPLACE_MALLOC_FOR_MALLOC_POSIX])
REPLACE_MBTOWC=0; AC_SUBST([REPLACE_MBTOWC])
+ REPLACE_MKOSTEMP=0; AC_SUBST([REPLACE_MKOSTEMP])
+ REPLACE_MKOSTEMPS=0; AC_SUBST([REPLACE_MKOSTEMPS])
REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP])
REPLACE_POSIX_MEMALIGN=0; AC_SUBST([REPLACE_POSIX_MEMALIGN])
REPLACE_POSIX_OPENPT=0; AC_SUBST([REPLACE_POSIX_OPENPT])
stdlib
extensions
largefile
-tempname [test $HAVE_MKOSTEMP = 0]
+tempname [test $HAVE_MKOSTEMP = 0 || test $REPLACE_MKOSTEMP = 1]
configure.ac:
gl_FUNC_MKOSTEMP
-gl_CONDITIONAL([GL_COND_OBJ_MKOSTEMP], [test $HAVE_MKOSTEMP = 0])
+gl_CONDITIONAL([GL_COND_OBJ_MKOSTEMP],
+ [test $HAVE_MKOSTEMP = 0 || test $REPLACE_MKOSTEMP = 1])
AM_COND_IF([GL_COND_OBJ_MKOSTEMP], [
gl_PREREQ_MKOSTEMP
])
stdlib
extensions
largefile
-tempname [test $HAVE_MKOSTEMPS = 0]
+tempname [test $HAVE_MKOSTEMPS = 0 || test $REPLACE_MKOSTEMPS = 1]
configure.ac:
gl_FUNC_MKOSTEMPS
-gl_CONDITIONAL([GL_COND_OBJ_MKOSTEMPS], [test $HAVE_MKOSTEMPS = 0])
+gl_CONDITIONAL([GL_COND_OBJ_MKOSTEMPS],
+ [test $HAVE_MKOSTEMPS = 0 || test $REPLACE_MKOSTEMPS = 1])
gl_MODULE_INDICATOR([mkostemps])
gl_STDLIB_MODULE_INDICATOR([mkostemps])
-e 's|@''REPLACE_MALLOC_FOR_MALLOC_GNU''@|$(REPLACE_MALLOC_FOR_MALLOC_GNU)|g' \
-e 's|@''REPLACE_MALLOC_FOR_MALLOC_POSIX''@|$(REPLACE_MALLOC_FOR_MALLOC_POSIX)|g' \
-e 's|@''REPLACE_MBTOWC''@|$(REPLACE_MBTOWC)|g' \
+ -e 's|@''REPLACE_MKOSTEMP''@|$(REPLACE_MKOSTEMP)|g' \
+ -e 's|@''REPLACE_MKOSTEMPS''@|$(REPLACE_MKOSTEMPS)|g' \
-e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \
-e 's|@''REPLACE_POSIX_MEMALIGN''@|$(REPLACE_POSIX_MEMALIGN)|g' \
-e 's|@''REPLACE_POSIX_OPENPT''@|$(REPLACE_POSIX_OPENPT)|g' \