The module 'getlocalename_l-unsafe-limited' was supposed to be used only on
NetBSD and Solaris, because that's what strftime.c needed, so far.

With this patch, it can also be used on glibc, musl, macOS, FreeBSD, Haiku,
Cygwin, native Windows. The added dependencies are not large.


2025-07-15  Bruno Haible  <br...@clisp.org>

        getlocalename_l-unsafe-limited: Extend to more platforms.
        * modules/getlocalename_l-unsafe-limited (Description): Update platforms
        list.
        (Files): Add m4/intl-thread-locale.m4.
        (Depends-on): Add setlocale-fixes.
        (configure.ac): Invoke gl_FUNC_GETLOCALENAME_L_UNSAFE and
        gl_PREREQ_GETLOCALENAME_L_UNSAFE. Update platforms list.

diff --git a/modules/getlocalename_l-unsafe-limited 
b/modules/getlocalename_l-unsafe-limited
index dd91b7a1b6..a9d4a4370a 100644
--- a/modules/getlocalename_l-unsafe-limited
+++ b/modules/getlocalename_l-unsafe-limited
@@ -1,20 +1,24 @@
 Description:
 getlocalename_l_unsafe() function: return name of a single locale category.
-Only works on a limited set of platforms: on NetBSD and Solaris.
+Only works on a limited set of platforms: all except OpenBSD, AIX, Android.
 
 Files:
 lib/getlocalename_l-unsafe.h
 lib/getlocalename_l-unsafe.c
 m4/getlocalename_l.m4
+m4/intl-thread-locale.m4
 
 Depends-on:
 locale-h
+setlocale-fixes
 setlocale-null
 
 configure.ac:
+gl_FUNC_GETLOCALENAME_L_UNSAFE
+gl_PREREQ_GETLOCALENAME_L_UNSAFE
 AC_REQUIRE([AC_CANONICAL_HOST])
 gl_CONDITIONAL([GL_COND_OBJ_GETLOCALENAME_L_UNSAFE_LIMITED],
-               [case "$host_os" in netbsd* | solaris*) true;; *) false;; esac])
+               [case "$host_os" in openbsd* | aix* | *-android*) false;; *) 
true;; esac])
 
 Makefile.am:
 if GL_COND_OBJ_GETLOCALENAME_L_UNSAFE_LIMITED




Reply via email to