]> Savannah Git Hosting - gnulib.git/commitdiff
localename: Add more comments.
authorBruno Haible <bruno@clisp.org>
Thu, 15 Feb 2024 13:35:53 +0000 (14:35 +0100)
committerBruno Haible <bruno@clisp.org>
Thu, 15 Feb 2024 18:42:14 +0000 (19:42 +0100)
* m4/intl-thread-locale.m4: Document expected configuration results.
* doc/posix-functions/uselocale.texi: Update platforms list.
* lib/localename.c: Likewise.

ChangeLog
doc/posix-functions/uselocale.texi
lib/localename.c
m4/intl-thread-locale.m4

index 531d5ffa57084bd2e769a37212428d83ade4719c..365a8d07e0e6923e880ba9f2dae159f429ce111b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-02-15  Bruno Haible  <bruno@clisp.org>
+
+       localename: Add more comments.
+       * m4/intl-thread-locale.m4: Document expected configuration results.
+       * doc/posix-functions/uselocale.texi: Update platforms list.
+       * lib/localename.c: Likewise.
+
 2024-02-15  Bruno Haible  <bruno@clisp.org>
 
        localename: Add parameter validation.
index e6ded0caf4bd63ffb99e703ba55e0ba095415872..600d4c1e2895e727e216a0dac25d3e4a30e8160e 100644 (file)
@@ -14,7 +14,8 @@ Portability problems not fixed by Gnulib:
 @itemize
 @item
 This function is missing on many platforms:
-FreeBSD 9.0, NetBSD 9.0, OpenBSD 6.1, Minix 3.1.8, AIX 6.1, HP-UX 11, IRIX 6.5, Solaris 11.3, Cygwin 2.5.x, mingw, MSVC 14, Android 4.4.
+@c For NetBSD, see https://mail-index.netbsd.org/tech-userlevel/2015/12/29/msg009556.html
+FreeBSD 9.0, NetBSD 10.0, OpenBSD 6.1, Minix 3.1.8, AIX 6.1, HP-UX 11, IRIX 6.5, Solaris 11.3, Cygwin 2.5.x, mingw, MSVC 14, Android API level 20.
 @item
 This function is not documented and leads to crashes in subsequent
 @code{setlocale} invocations on some platforms:
@@ -26,5 +27,5 @@ z/OS.
 @item
 This function is useless because the @code{locale_t} type contains basically
 no information on some platforms:
-OpenBSD 6.3.
+OpenBSD 7.4.
 @end itemize
index 72f773bbed07e803daa97b67217410af18df1357..1bdc73f1cbf9e23cf5c63b13e8776d50965d0920 100644 (file)
@@ -2630,8 +2630,10 @@ get_lcid (const char *locale_name)
 #endif
 
 
-#if HAVE_GOOD_USELOCALE /* glibc, Mac OS X, FreeBSD >= 9.1, Cygwin >= 2.6,
-                           Solaris 11 OpenIndiana, or Solaris >= 11.4  */
+#if HAVE_GOOD_USELOCALE /* glibc, musl libc, macOS, FreeBSD >= 9.1, AIX 7.1,
+                           AIX >= 7.3, Solaris >= 11.4, Solaris 11 OpenIndiana,
+                           Solaris 11 OmniOS, Cygwin >= 2.6,
+                           Android API level >= 21 */
 
 /* Simple hash set of strings.  We don't want to drag in lots of hash table
    code here.  */
index 74a2654b651a895a6f1b99965dc3243655c81484..9710cb6d849ee19d462f6761216b147c1180c701 100644 (file)
@@ -1,4 +1,4 @@
-# intl-thread-locale.m4 serial 10
+# intl-thread-locale.m4 serial 11
 dnl Copyright (C) 2015-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,
@@ -38,6 +38,7 @@ AC_DEFUN([gt_INTL_THREAD_LOCALE_NAME],
   dnl they did not think about the programs.
   dnl In this situation, even the HAVE_NAMELESS_LOCALES support does not work.
   dnl So, define HAVE_FAKE_LOCALES and disable all locale_t support.
+  dnl Expected result: HAVE_FAKE_LOCALES is defined on OpenBSD ≥ 6.2.
   case "$gt_cv_func_uselocale_works" in
     *yes)
       AC_CHECK_HEADERS_ONCE([xlocale.h])
@@ -81,6 +82,7 @@ int main ()
       ;;
   esac
 
+  dnl Expected result: HAVE_SOLARIS114_LOCALES is defined on Solaris ≥ 11.4.
   case "$gt_cv_func_uselocale_works" in
     *yes)
       AC_CACHE_CHECK([for Solaris 11.4 locale system],
@@ -128,6 +130,7 @@ int main ()
   dnl requires the gnulib overrides of 'newlocale', 'duplocale', 'freelocale',
   dnl which is a problem for GNU libunistring.  Therefore try hard to avoid
   dnl enabling this code!
+  dnl Expected result: HAVE_NAMELESS_LOCALES is defined on AIX.
   gt_nameless_locales=no
   case "$host_os" in
     dnl It's needed on AIX 7.2.
@@ -141,6 +144,9 @@ int main ()
   dnl We cannot support uselocale() on platforms where the locale_t type is
   dnl fake.  So, set
   dnl   gt_good_uselocale = gt_working_uselocale && !gt_fake_locales.
+  dnl Expected result: HAVE_GOOD_USELOCALE is defined on all platforms except
+  dnl FreeBSD < 9.1, NetBSD, OpenBSD, Minix, AIX < 7, AIX 7.2, HP-UX, IRIX,
+  dnl Solaris < 11.4, Cygwin < 2.6, mingw, MSVC 14, Android API level < 21.
   if test $gt_working_uselocale = yes && test $gt_fake_locales = no; then
     gt_good_uselocale=yes
     AC_DEFINE([HAVE_GOOD_USELOCALE], [1],
@@ -152,6 +158,8 @@ int main ()
   dnl Set gt_localename_enhances_locale_funcs to indicate whether localename.c
   dnl overrides newlocale(), duplocale(), freelocale() to keep track of locale
   dnl names.
+  dnl Expected result: LOCALENAME_ENHANCE_LOCALE_FUNCS is defined on
+  dnl AIX 7.1, AIX ≥ 7.3.
   if test $gt_good_uselocale = yes && test $gt_nameless_locales = yes; then
     gt_localename_enhances_locale_funcs=yes
     LOCALENAME_ENHANCE_LOCALE_FUNCS=1
@@ -164,6 +172,9 @@ int main ()
 
 dnl Tests whether uselocale() exists and is usable.
 dnl Sets gt_working_uselocale and defines HAVE_WORKING_USELOCALE.
+dnl Expected result: HAVE_WORKING_USELOCALE is defined on all platforms except
+dnl FreeBSD < 9.1, NetBSD, OpenBSD < 6.2, Minix, AIX < 7, AIX 7.2, HP-UX, IRIX,
+dnl Solaris < 11.4, Cygwin < 2.6, mingw, MSVC 14, Android API level < 21.
 AC_DEFUN([gt_FUNC_USELOCALE],
 [
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles