Resolve conflicts for functions introduced in Android API level 21.
+ * lib/stdlib.in.h (_Exit): Consider REPLACE__EXIT. Disable
+ _GL_CXXALIASWARN invocation on non-glibc systems.
+ (getprogname): Consider REPLACE_GETPROGNAME. Disable _GL_CXXALIASWARN
+ invocation on non-glibc systems.
+ (posix_openpt): Consider REPLACE_POSIX_OPENPT. Disable _GL_CXXALIASWARN
+ invocation on non-glibc systems.
+ * m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Initialize REPLACE__EXIT,
+ REPLACE_GETPROGNAME, REPLACE_POSIX_OPENPT.
+ * modules/stdlib (Makefile.am): Substitute REPLACE__EXIT,
+ REPLACE_GETPROGNAME, REPLACE_POSIX_OPENPT.
+ * m4/_Exit.m4 (gl_FUNC__EXIT): Conditionally set REPLACE__EXIT.
+ * modules/_Exit (configure.ac): Consider REPLACE__EXIT.
+ * m4/getprogname.m4 (gl_FUNC_GETPROGNAME): Conditionally set
+ REPLACE_GETPROGNAME.
+ * modules/getprogname (configure.ac): Consider REPLACE_GETPROGNAME.
+ * m4/posix_openpt.m4 (gl_FUNC_POSIX_OPENPT): Conditionally set
+ REPLACE_POSIX_OPENPT.
+ * modules/posix_openpt (configure.ac): Consider REPLACE_POSIX_OPENPT.
+
* lib/search.in.h (twalk): Consider REPLACE_TWALK.
* m4/search_h.m4 (gl_SEARCH_H_DEFAULTS): Initialize REPLACE_TWALK.
* modules/search (Makefile.am): Substitute REPLACE_TWALK.
#if @GNULIB__EXIT@
/* Terminate the current process with the given return code, without running
the 'atexit' handlers. */
-# if !@HAVE__EXIT@
+# if @REPLACE__EXIT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef _Exit
+# define _Exit rpl__Exit
+# endif
+_GL_FUNCDECL_RPL (_Exit, _Noreturn void, (int status));
+_GL_CXXALIAS_RPL (_Exit, void, (int status));
+# else
+# if !@HAVE__EXIT@
_GL_FUNCDECL_SYS (_Exit, _Noreturn void, (int status));
-# endif
+# endif
_GL_CXXALIAS_SYS (_Exit, void, (int status));
+# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (_Exit);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef _Exit
# if HAVE_RAW_DECL__EXIT
#if @GNULIB_GETPROGNAME@
/* Return the base name of the executing program.
On native Windows this will usually end in ".exe" or ".EXE". */
-# if !@HAVE_GETPROGNAME@
+# if @REPLACE_GETPROGNAME@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef getprogname
+# define getprogname rpl_getprogname
+# endif
# ifdef HAVE_DECL_PROGRAM_INVOCATION_NAME
-_GL_FUNCDECL_SYS (getprogname, const char *, (void) _GL_ATTRIBUTE_PURE);
+_GL_FUNCDECL_RPL (getprogname, const char *, (void) _GL_ATTRIBUTE_PURE);
# else
+_GL_FUNCDECL_RPL (getprogname, const char *, (void));
+# endif
+_GL_CXXALIAS_RPL (getprogname, const char *, (void));
+# else
+# if !@HAVE_GETPROGNAME@
+# ifdef HAVE_DECL_PROGRAM_INVOCATION_NAME
+_GL_FUNCDECL_SYS (getprogname, const char *, (void) _GL_ATTRIBUTE_PURE);
+# else
_GL_FUNCDECL_SYS (getprogname, const char *, (void));
+# endif
# endif
-# endif
_GL_CXXALIAS_SYS (getprogname, const char *, (void));
+# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (getprogname);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef getprogname
# if HAVE_RAW_DECL_GETPROGNAME
#if @GNULIB_POSIX_OPENPT@
/* Return an FD open to the master side of a pseudo-terminal. Flags should
include O_RDWR, and may also include O_NOCTTY. */
-# if !@HAVE_POSIX_OPENPT@
+# if @REPLACE_POSIX_OPENPT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef posix_openpt
+# define posix_openpt rpl_posix_openpt
+# endif
+_GL_FUNCDECL_RPL (posix_openpt, int, (int flags));
+_GL_CXXALIAS_RPL (posix_openpt, int, (int flags));
+# else
+# if !@HAVE_POSIX_OPENPT@
_GL_FUNCDECL_SYS (posix_openpt, int, (int flags));
-# endif
+# endif
_GL_CXXALIAS_SYS (posix_openpt, int, (int flags));
+# endif
+# if __GLIBC__ >= 2
_GL_CXXALIASWARN (posix_openpt);
+# endif
#elif defined GNULIB_POSIXCHECK
# undef posix_openpt
# if HAVE_RAW_DECL_POSIX_OPENPT
-# _Exit.m4 serial 3
+# _Exit.m4 serial 4
dnl Copyright (C) 2010-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([_Exit], [[#include <stdlib.h>]])
if test $ac_cv_func__Exit = no; then
HAVE__EXIT=0
+ case "$gl_cv_onwards_func__Exit" in
+ future*) REPLACE__EXIT=1 ;;
+ esac
fi
])
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 6
+# serial 7
AC_DEFUN([gl_FUNC_GETPROGNAME],
[
gl_CHECK_FUNCS_ANDROID([getprogname], [[#include <stdlib.h>]])
if test $ac_cv_func_getprogname = no; then
HAVE_GETPROGNAME=0
+ case "$gl_cv_onwards_func_getprogname" in
+ future*) REPLACE_GETPROGNAME=1 ;;
+ esac
fi
])
-# posix_openpt.m4 serial 3
+# posix_openpt.m4 serial 4
dnl Copyright (C) 2011-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_posix_openpt != yes; then
dnl The system does not have posix_openpt.
HAVE_POSIX_OPENPT=0
+ case "$gl_cv_onwards_func_posix_openpt" in
+ future*) REPLACE_POSIX_OPENPT=1 ;;
+ esac
fi
])
-# stdlib_h.m4 serial 67
+# stdlib_h.m4 serial 68
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,
HAVE_SYS_LOADAVG_H=0; AC_SUBST([HAVE_SYS_LOADAVG_H])
HAVE_UNLOCKPT=1; AC_SUBST([HAVE_UNLOCKPT])
HAVE_DECL_UNSETENV=1; AC_SUBST([HAVE_DECL_UNSETENV])
+ REPLACE__EXIT=0; AC_SUBST([REPLACE__EXIT])
REPLACE_ALIGNED_ALLOC=0; AC_SUBST([REPLACE_ALIGNED_ALLOC])
REPLACE_CALLOC_FOR_CALLOC_GNU=0; AC_SUBST([REPLACE_CALLOC_FOR_CALLOC_GNU])
REPLACE_CALLOC_FOR_CALLOC_POSIX=0; AC_SUBST([REPLACE_CALLOC_FOR_CALLOC_POSIX])
REPLACE_CANONICALIZE_FILE_NAME=0; AC_SUBST([REPLACE_CANONICALIZE_FILE_NAME])
REPLACE_FREE=0; AC_SUBST([REPLACE_FREE])
+ REPLACE_GETPROGNAME=0; AC_SUBST([REPLACE_GETPROGNAME])
REPLACE_INITSTATE=0; AC_SUBST([REPLACE_INITSTATE])
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_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP])
REPLACE_POSIX_MEMALIGN=0; AC_SUBST([REPLACE_POSIX_MEMALIGN])
+ REPLACE_POSIX_OPENPT=0; AC_SUBST([REPLACE_POSIX_OPENPT])
REPLACE_PTSNAME=0; AC_SUBST([REPLACE_PTSNAME])
REPLACE_PTSNAME_R=0; AC_SUBST([REPLACE_PTSNAME_R])
REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV])
configure.ac:
gl_FUNC__EXIT
-gl_CONDITIONAL([GL_COND_OBJ__EXIT], [test $HAVE__EXIT = 0])
+gl_CONDITIONAL([GL_COND_OBJ__EXIT],
+ [test $HAVE__EXIT = 0 || test $REPLACE__EXIT = 1])
AM_COND_IF([GL_COND_OBJ__EXIT], [
gl_PREREQ__EXIT
])
configure.ac:
gl_FUNC_GETPROGNAME
-gl_CONDITIONAL([GL_COND_OBJ_GETPROGNAME], [test $HAVE_GETPROGNAME = 0])
+gl_CONDITIONAL([GL_COND_OBJ_GETPROGNAME],
+ [test $HAVE_GETPROGNAME = 0 || test $REPLACE_GETPROGNAME = 1])
AM_COND_IF([GL_COND_OBJ_GETPROGNAME], [
gl_PREREQ_GETPROGNAME
])
configure.ac:
gl_FUNC_POSIX_OPENPT
-gl_CONDITIONAL([GL_COND_OBJ_POSIX_OPENPT], [test $HAVE_POSIX_OPENPT = 0])
+gl_CONDITIONAL([GL_COND_OBJ_POSIX_OPENPT],
+ [test $HAVE_POSIX_OPENPT = 0 || test $REPLACE_POSIX_OPENPT = 1])
gl_STDLIB_MODULE_INDICATOR([posix_openpt])
Makefile.am:
-e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \
-e 's|@''HAVE_UNLOCKPT''@|$(HAVE_UNLOCKPT)|g' \
-e 's|@''HAVE_DECL_UNSETENV''@|$(HAVE_DECL_UNSETENV)|g' \
+ -e 's|@''REPLACE__EXIT''@|$(REPLACE__EXIT)|g' \
-e 's|@''REPLACE_ALIGNED_ALLOC''@|$(REPLACE_ALIGNED_ALLOC)|g' \
-e 's|@''REPLACE_CALLOC_FOR_CALLOC_GNU''@|$(REPLACE_CALLOC_FOR_CALLOC_GNU)|g' \
-e 's|@''REPLACE_CALLOC_FOR_CALLOC_POSIX''@|$(REPLACE_CALLOC_FOR_CALLOC_POSIX)|g' \
-e 's|@''REPLACE_CANONICALIZE_FILE_NAME''@|$(REPLACE_CANONICALIZE_FILE_NAME)|g' \
-e 's|@''REPLACE_FREE''@|$(REPLACE_FREE)|g' \
+ -e 's|@''REPLACE_GETPROGNAME''@|$(REPLACE_GETPROGNAME)|g' \
-e 's|@''REPLACE_INITSTATE''@|$(REPLACE_INITSTATE)|g' \
-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_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \
-e 's|@''REPLACE_POSIX_MEMALIGN''@|$(REPLACE_POSIX_MEMALIGN)|g' \
+ -e 's|@''REPLACE_POSIX_OPENPT''@|$(REPLACE_POSIX_OPENPT)|g' \
-e 's|@''REPLACE_PTSNAME''@|$(REPLACE_PTSNAME)|g' \
-e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \
-e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \