]> Savannah Git Hosting - gnulib.git/commitdiff
Resolve conflicts for functions introduced in Android API level 21.
authorBruno Haible <bruno@clisp.org>
Sun, 22 Jan 2023 10:48:22 +0000 (11:48 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 22 Jan 2023 14:56:27 +0000 (15:56 +0100)
* 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.

ChangeLog
lib/stdlib.in.h
m4/_Exit.m4
m4/getprogname.m4
m4/posix_openpt.m4
m4/stdlib_h.m4
modules/_Exit
modules/getprogname
modules/posix_openpt
modules/stdlib

index b6deccf06537340e9d73f513e864a62d5f2415e1..80063baa0fe4c4628fd546d2c35cde06f17540c2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,25 @@
 
        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.
index 018e7945dbf7284d83ac6ce98889e59b5486394b..88a8e034a1eee9f7ff999e81d38e226186a5e479 100644 (file)
@@ -164,11 +164,22 @@ struct random_data
 #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
@@ -433,15 +444,30 @@ _GL_WARN_ON_USE (getloadavg, "getloadavg is not portable - "
 #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
@@ -747,11 +773,22 @@ _GL_WARN_ON_USE (posix_memalign, "posix_memalign is not portable - "
 #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
index 61e1f848b705b4296ed130d1aa6265875105d18e..8f032a7c925a55c040946f9c4d8956c365335352 100644 (file)
@@ -1,4 +1,4 @@
-# _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,
@@ -10,6 +10,9 @@ AC_DEFUN([gl_FUNC__EXIT],
   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
 ])
 
index 0a4b9c874a8591b91dd34a354191a38e81c60cd7..b8636e143a7ed55e0fe823187bff665ec871ed44 100644 (file)
@@ -5,13 +5,16 @@
 # 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
 ])
 
index f5912a12bb1d82f9ea6bcf28bc409e700219e3f1..7aaa495b631124e0f7b733d9d46674887652caa4 100644 (file)
@@ -1,4 +1,4 @@
-# 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,
@@ -15,5 +15,8 @@ AC_DEFUN([gl_FUNC_POSIX_OPENPT],
   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
 ])
index f1f2d04047ca709aa2758c51fd061ca541563b84..f1360a457b114b4015923d3b2ea6c95bcc9eff67 100644 (file)
@@ -1,4 +1,4 @@
-# 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,
@@ -168,17 +168,20 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
   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])
index fa4bde0554d0eb033a0b8d589b542bc161e938e3..75f0399e88b98e012d299f7b6bda8cc9c2d5b5d2 100644 (file)
@@ -11,7 +11,8 @@ unistd
 
 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
 ])
index dadbffbbd622c1d19d4f2c8aab80779b48ee9230..0631589ee6abcc2e975749be5c358962ffc6870f 100644 (file)
@@ -14,7 +14,8 @@ open            [test $HAVE_GETPROGNAME = 0]
 
 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
 ])
index 96a42298798d198c198b2af8be4b8f8d7d97f003..1b065e10d05c7ace0183205e1bd5905029e972f3 100644 (file)
@@ -11,7 +11,8 @@ stdlib
 
 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:
index 1e6e18f53c255c6d3dac34d89d121755f2694734..0be8fb54a55b3092ee2019d1ee4ce2e0b747dcd5 100644 (file)
@@ -128,17 +128,20 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
              -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' \