]> Savannah Git Hosting - gnulib.git/commitdiff
iswdigit: Work around OpenBSD, Android, Haiku bug.
authorBruno Haible <bruno@clisp.org>
Sat, 31 Aug 2024 22:11:12 +0000 (00:11 +0200)
committerBruno Haible <bruno@clisp.org>
Tue, 17 Sep 2024 11:21:12 +0000 (13:21 +0200)
* m4/iswdigit.m4 (gl_FUNC_ISWDIGIT): Require gt_LOCALE_EN_UTF8 instead
of gt_LOCALE_FR_UTF8. Use LOCALE_EN_UTF8 instead of LOCALE_FR_UTF8.
Update cross-compilation guess.
* modules/iswdigit (Files): Add m4/locale-en.m4.
* doc/posix-functions/iswdigit.texi: Update list of platforms.

ChangeLog
doc/posix-functions/iswdigit.texi
m4/iswdigit.m4
modules/iswdigit

index a8429ed77c734163a6236a93c4eb672d8cba34e3..08899722062724568fe46c74ef14a9ed6bec61ef 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2024-08-31  Bruno Haible  <bruno@clisp.org>
+
+       iswdigit: Work around OpenBSD, Android, Haiku bug.
+       * m4/iswdigit.m4 (gl_FUNC_ISWDIGIT): Require gt_LOCALE_EN_UTF8 instead
+       of gt_LOCALE_FR_UTF8. Use LOCALE_EN_UTF8 instead of LOCALE_FR_UTF8.
+       Update cross-compilation guess.
+       * modules/iswdigit (Files): Add m4/locale-en.m4.
+       * doc/posix-functions/iswdigit.texi: Update list of platforms.
+
 2024-08-31  Bruno Haible  <bruno@clisp.org>
 
        Prepare for stronger LC_CTYPE tests on OpenBSD, Android, Haiku.
index c3e49f99e412b77093193673cf6b658625dd093a..9f05dd39ca060cf3b94983c0ecb841490be3fa0a 100644 (file)
@@ -17,7 +17,7 @@ on some platforms:
 macOS 10.8.
 @item
 This function is not ISO C 99 compliant on some platforms:
-FreeBSD 14.0, NetBSD 10.0, Solaris 11.4, mingw, MSVC 14.
+FreeBSD 14.0, NetBSD 10.0, OpenBSD 7.5, Solaris 11.4, mingw, MSVC 14, Haiku, Android.
 @end itemize
 
 Portability problems not fixed by Gnulib:
index 999acd2891487641e2e64ec8752a5b178a955f3c..f07feae4954a925f6d4e6067eab697261e9478df 100644 (file)
@@ -1,5 +1,5 @@
 # iswdigit.m4
-# serial 7
+# serial 9
 dnl Copyright (C) 2020-2024 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -11,7 +11,7 @@ AC_DEFUN([gl_FUNC_ISWDIGIT],
   AC_REQUIRE([gl_WCTYPE_H])
   AC_REQUIRE([gt_LOCALE_FR])
   AC_REQUIRE([gt_LOCALE_JA])
-  AC_REQUIRE([gt_LOCALE_FR_UTF8])
+  AC_REQUIRE([gt_LOCALE_EN_UTF8])
   AC_REQUIRE([gt_LOCALE_ZH_CN])
   AC_REQUIRE([AC_CANONICAL_HOST])
 
@@ -26,14 +26,14 @@ AC_DEFUN([gl_FUNC_ISWDIGIT],
        dnl is present.
 changequote(,)dnl
        case "$host_os" in
-         # Guess no on FreeBSD, NetBSD, Solaris, native Windows.
-         freebsd* | dragonfly* | netbsd* | solaris* | mingw* | windows*)
+         # Guess no on FreeBSD, NetBSD, OpenBSD, Solaris, native Windows, Haiku, Android.
+         freebsd* | dragonfly* | netbsd* | openbsd* | solaris* | mingw* | windows* | haiku* | *-android*)
            gl_cv_func_iswdigit_works="guessing no" ;;
          # Guess yes otherwise.
          *) gl_cv_func_iswdigit_works="guessing yes" ;;
        esac
 changequote([,])dnl
-       if test $LOCALE_FR != none || test $LOCALE_JA != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_ZH_CN != none; then
+       if test $LOCALE_FR != none || test $LOCALE_JA != none || test "$LOCALE_EN_UTF8" != none || test $LOCALE_ZH_CN != none; then
          AC_RUN_IFELSE(
            [AC_LANG_SOURCE([[
 #include <locale.h>
@@ -83,15 +83,15 @@ main (int argc, char *argv[])
       if (!(is == 0))
         result |= 2;
     }
-  if (strcmp ("$LOCALE_FR_UTF8", "none") != 0
-      && setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+  if (strcmp ("$LOCALE_EN_UTF8", "none") != 0
+      && setlocale (LC_ALL, "$LOCALE_EN_UTF8") != NULL)
     {
-      /* This fails on FreeBSD 13.0, NetBSD 10.0, MSVC 14.  */
+      /* This fails on FreeBSD 13.0, NetBSD 10.0, OpenBSD 7.5, MSVC 14, Haiku, Android.  */
       /* U+0663 ARABIC-INDIC DIGIT THREE */
       is = for_character ("\331\243", 2);
       if (!(is == 0))
         result |= 4;
-      /* This fails on FreeBSD 13.0, NetBSD 10.0, MSVC 14.  */
+      /* This fails on FreeBSD 13.0, NetBSD 10.0, OpenBSD 7.5, MSVC 14, Haiku, Android.  */
       /* U+FF11 FULLWIDTH DIGIT ONE */
       is = for_character ("\357\274\221", 3);
       if (!(is == 0))
index afa30b8de5f6b8edd6307f2651dc44e40cca5829..1a0091a01cf5fbf93cc2b7333c3e063c4e8e4dd4 100644 (file)
@@ -4,6 +4,7 @@ iswdigit() function: test wide character for being a digit.
 Files:
 lib/iswdigit.c
 m4/iswdigit.m4
+m4/locale-en.m4
 m4/locale-fr.m4
 m4/locale-ja.m4
 m4/locale-zh.m4