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

ChangeLog
lib/stdlib.in.h
m4/mkostemp.m4
m4/mkostemps.m4
m4/stdlib_h.m4
modules/mkostemp
modules/mkostemps
modules/stdlib

index c00928615f9e32871effdc2bcf8fb266875888e9..8c6d6dcf6a87133de9f3b54cc1f055d6d39e2a03 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+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.
index c9e247547725278227ddec6e219a34f4467bbf47..95e0b847b9583ecc0bff13c4c407b7d98c0b569b 100644 (file)
@@ -625,12 +625,24 @@ _GL_WARN_ON_USE (mkdtemp, "mkdtemp is unportable - "
    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
@@ -653,14 +665,28 @@ _GL_WARN_ON_USE (mkostemp, "mkostemp is unportable - "
    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
index 9424f85f430f88c22c68aba785c1d34f0daa727e..1b0d0d559466b9af571868162b024992aac9376c 100644 (file)
@@ -1,4 +1,4 @@
-# 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,
@@ -14,6 +14,9 @@ AC_DEFUN([gl_FUNC_MKOSTEMP],
   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
 ])
 
index fdf6971496513dafcd2be142d5ff8bb40b45a68c..2ce47d130f160dbe5f7a186a7e655b99e9a5ca4e 100644 (file)
@@ -1,4 +1,4 @@
-# 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,
@@ -14,5 +14,8 @@ AC_DEFUN([gl_FUNC_MKOSTEMPS],
   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
 ])
index f1360a457b114b4015923d3b2ea6c95bcc9eff67..525cd5ba783264f1fdb3841966c4adfb5aaf0e6d 100644 (file)
@@ -1,4 +1,4 @@
-# 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,
@@ -179,6 +179,8 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
   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])
index 467fb109ae4525beb1fdcad7e47adfe098b9b9c7..a47353d42728ef42db0ef620b860f9fdde783719 100644 (file)
@@ -10,11 +10,12 @@ Depends-on:
 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
 ])
index 92ef9ea29eebb3a1de854269af76e8147460d0ac..3bcb438860c9a90454ef33b5340371605b3fb058 100644 (file)
@@ -10,11 +10,12 @@ Depends-on:
 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])
 
index 0be8fb54a55b3092ee2019d1ee4ce2e0b747dcd5..57f1e4026978819239551cdeb491083a6a04dca0 100644 (file)
@@ -139,6 +139,8 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
              -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' \