Resolve conflicts for functions introduced in Android API level 21.
authorBruno Haible <bruno@clisp.org>
Sun, 22 Jan 2023 11:19:58 +0000 (12:19 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 22 Jan 2023 14:56:33 +0000 (15:56 +0100)
* m4/duplocale.m4 (gl_FUNC_DUPLOCALE): Conditionally set
REPLACE_DUPLOCALE.
* m4/localename.m4 (gl_LOCALENAME): Conditionally set REPLACE_NEWLOCALE,
REPLACE_DUPLOCALE, REPLACE_FREELOCALE.
* lib/locale.in.h (newlocale, duplocale, freelocale): Disable
_GL_CXXALIASWARN invocation on non-glibc systems.

ChangeLog
lib/locale.in.h
m4/duplocale.m4
m4/localename.m4

index 22a28b2fd3f6d20bcd9f9f8247e035233086a1d6..a6f1cb08a0f3456bce218337f278afe5045bf9ac 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,13 @@
 
        Resolve conflicts for functions introduced in Android API level 21.
 
+       * m4/duplocale.m4 (gl_FUNC_DUPLOCALE): Conditionally set
+       REPLACE_DUPLOCALE.
+       * m4/localename.m4 (gl_LOCALENAME): Conditionally set REPLACE_NEWLOCALE,
+       REPLACE_DUPLOCALE, REPLACE_FREELOCALE.
+       * lib/locale.in.h (newlocale, duplocale, freelocale): Disable
+       _GL_CXXALIASWARN invocation on non-glibc systems.
+
        * lib/unistd.in.h (dup3): Consider REPLACE_DUP3. Disable
        _GL_CXXALIASWARN invocation on non-glibc systems.
        * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Initialize REPLACE_DUP3.
index 538b83412b4180bbeb0ea46e905de1ec2bc8bf0a..e9c34182e5587400200f3ba1793dd6068e9d7705 100644 (file)
@@ -229,7 +229,7 @@ _GL_CXXALIAS_SYS (newlocale, locale_t,
                   (int category_mask, const char *name, locale_t base));
 #  endif
 # endif
-# if @HAVE_NEWLOCALE@
+# if __GLIBC__ >= 2 && @HAVE_NEWLOCALE@
 _GL_CXXALIASWARN (newlocale);
 # endif
 # if @HAVE_NEWLOCALE@ || @REPLACE_NEWLOCALE@
@@ -258,7 +258,7 @@ _GL_CXXALIAS_RPL (duplocale, locale_t, (locale_t locale));
 _GL_CXXALIAS_SYS (duplocale, locale_t, (locale_t locale));
 #  endif
 # endif
-# if @HAVE_DUPLOCALE@
+# if __GLIBC__ >= 2 && @HAVE_DUPLOCALE@
 _GL_CXXALIASWARN (duplocale);
 # endif
 # if @HAVE_DUPLOCALE@ || @REPLACE_DUPLOCALE@
@@ -290,7 +290,7 @@ _GL_CXXALIAS_RPL (freelocale, void, (locale_t locale));
 _GL_CXXALIAS_SYS_CAST (freelocale, void, (locale_t locale));
 #  endif
 # endif
-# if @HAVE_FREELOCALE@
+# if __GLIBC__ >= 2 && @HAVE_FREELOCALE@
 _GL_CXXALIASWARN (freelocale);
 # endif
 #elif defined GNULIB_POSIXCHECK
index 22b4bf80bde3209883e7e9c022f43ce293184f8b..54349e920abba513b0331285a4d68ea240893fd4 100644 (file)
@@ -1,4 +1,4 @@
-# duplocale.m4 serial 17
+# duplocale.m4 serial 18
 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,
@@ -110,6 +110,9 @@ int main ()
     fi
   else
     HAVE_DUPLOCALE=0
+    case "$gl_cv_onwards_func_duplocale" in
+      future*) REPLACE_DUPLOCALE=1 ;;
+    esac
   fi
   if test $REPLACE_DUPLOCALE = 1; then
     DUPLOCALE_LIB="$SETLOCALE_NULL_LIB"
index 43725d8444379fdb46db467d98828ff7e9791bfb..8c43a13aa092fae0e5f03ec1ce6e34391ea5bad6 100644 (file)
@@ -1,4 +1,4 @@
-# localename.m4 serial 9
+# localename.m4 serial 10
 dnl Copyright (C) 2007, 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,
@@ -22,18 +22,30 @@ AC_DEFUN([gl_LOCALENAME],
   else
     dnl In 2019, some versions of z/OS lack the locale_t type and have broken
     dnl newlocale, duplocale, freelocale functions.
+    gl_cv_onwards_func_newlocale='future OS version'
+    gl_cv_onwards_func_duplocale='future OS version'
+    gl_cv_onwards_func_freelocale='future OS version'
     gl_func_newlocale=no
     gl_func_duplocale=no
     gl_func_freelocale=no
   fi
   if test $gl_func_newlocale != yes; then
     HAVE_NEWLOCALE=0
+    case "$gl_cv_onwards_func_newlocale" in
+      future*) REPLACE_NEWLOCALE=1 ;;
+    esac
   fi
   if test $gl_func_duplocale != yes; then
     HAVE_DUPLOCALE=0
+    case "$gl_cv_onwards_func_duplocale" in
+      future*) REPLACE_DUPLOCALE=1 ;;
+    esac
   fi
   if test $gl_func_freelocale != yes; then
     HAVE_FREELOCALE=0
+    case "$gl_cv_onwards_func_freelocale" in
+      future*) REPLACE_FREELOCALE=1 ;;
+    esac
   fi
   if test $gt_localename_enhances_locale_funcs = yes; then
     REPLACE_NEWLOCALE=1