From: Bruno Haible Date: Sat, 31 Aug 2024 22:12:54 +0000 (+0200) Subject: iswxdigit: Work around OpenBSD, Android, Haiku bug. X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=04785e109584d7c64fc796d8cf78180d2d10d541;p=gnulib.git iswxdigit: Work around OpenBSD, Android, Haiku bug. * m4/iswxdigit.m4 (gl_FUNC_ISWXDIGIT): 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/iswxdigit (Files): Add m4/locale-en.m4. Remove m4/locale-fr.m4. --- diff --git a/ChangeLog b/ChangeLog index a0e6412775..b5de491a91 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2024-08-31 Bruno Haible + + iswxdigit: Work around OpenBSD, Android, Haiku bug. + * m4/iswxdigit.m4 (gl_FUNC_ISWXDIGIT): 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/iswxdigit (Files): Add m4/locale-en.m4. Remove m4/locale-fr.m4. + 2024-08-31 Bruno Haible iswdigit: Work around OpenBSD, Android, Haiku bug. diff --git a/m4/iswxdigit.m4 b/m4/iswxdigit.m4 index d42f0d1340..2fa3cb77a5 100644 --- a/m4/iswxdigit.m4 +++ b/m4/iswxdigit.m4 @@ -1,4 +1,4 @@ -# iswxdigit.m4 serial 6 +# iswxdigit.m4 serial 6.1 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, @@ -9,7 +9,7 @@ AC_DEFUN([gl_FUNC_ISWXDIGIT], AC_REQUIRE([gl_WCTYPE_H_DEFAULTS]) AC_REQUIRE([gl_WCTYPE_H]) 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]) @@ -24,14 +24,14 @@ AC_DEFUN([gl_FUNC_ISWXDIGIT], 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_iswxdigit_works="guessing no" ;; # Guess yes otherwise. *) gl_cv_func_iswxdigit_works="guessing yes" ;; esac changequote([,])dnl - if test $LOCALE_JA != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_ZH_CN != none; then + if test $LOCALE_JA != none || test "$LOCALE_EN_UTF8" != none || test $LOCALE_ZH_CN != none; then AC_RUN_IFELSE( [AC_LANG_SOURCE([[ #include @@ -72,15 +72,15 @@ main (int argc, char *argv[]) if (!(is == 0)) result |= 1; } - 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. */ + /* This fails on FreeBSD 13.0, Haiku, Android. */ /* U+0663 ARABIC-INDIC DIGIT THREE */ is = for_character ("\331\243", 2); if (!(is == 0)) result |= 2; - /* This fails on MSVC 14. */ + /* This fails on NetBSD 10.0, OpenBSD 7.5, MSVC 14, Haiku, Android. */ /* U+FF21 FULLWIDTH LATIN CAPITAL LETTER A */ is = for_character ("\357\274\241", 3); if (!(is == 0)) diff --git a/modules/iswxdigit b/modules/iswxdigit index 9261524c6e..a0cb6c5945 100644 --- a/modules/iswxdigit +++ b/modules/iswxdigit @@ -4,7 +4,7 @@ iswxdigit() function: test wide character for being a hexadecimal digit. Files: lib/iswxdigit.c m4/iswxdigit.m4 -m4/locale-fr.m4 +m4/locale-en.m4 m4/locale-ja.m4 m4/locale-zh.m4 m4/codeset.m4