> 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.
And similarly for the 'localename-unsafe-limited' module. The added dependencies here: localename-environ, strdup, windows-mutex. That's not a lot; especially not generic multithreading. 2025-07-15 Bruno Haible <[email protected]> localename-unsafe-limited: Extend to more platforms. * modules/localename-unsafe-limited (Description): Update platforms list. (Files): Add m4/intlmacosx.m4, m4/musl.m4. (Depends-on): Add localename-environ, strdup, windows-mutex. (configure.ac): Invoke gl_MUSL_LIBC. (Link): Add $(INTL_MACOSX_LIBS). * m4/localename.m4 (gl_LOCALENAME_UNSAFE): Don't require gl_LOCALE_H_DEFAULTS. (gl_LOCALENAME_UNSAFE_LIMITED): Require gt_INTL_MACOSX. diff --git a/m4/localename.m4 b/m4/localename.m4 index b5677d8944..5cb2648168 100644 --- a/m4/localename.m4 +++ b/m4/localename.m4 @@ -1,5 +1,5 @@ # localename.m4 -# serial 14 +# serial 15 dnl Copyright (C) 2007, 2009-2025 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -8,7 +8,6 @@ AC_DEFUN([gl_LOCALENAME_UNSAFE], [ - AC_REQUIRE([gl_LOCALE_H_DEFAULTS]) AC_REQUIRE([gt_LC_MESSAGES]) AC_REQUIRE([gt_INTL_MACOSX]) ]) @@ -16,6 +15,7 @@ AC_DEFUN([gl_LOCALENAME_UNSAFE] AC_DEFUN([gl_LOCALENAME_UNSAFE_LIMITED], [ AC_REQUIRE([gt_LC_MESSAGES]) + AC_REQUIRE([gt_INTL_MACOSX]) ]) AC_DEFUN([gl_LOCALENAME_ENVIRON], diff --git a/modules/localename-unsafe-limited b/modules/localename-unsafe-limited index 6737c0101f..f1b9f12205 100644 --- a/modules/localename-unsafe-limited +++ b/modules/localename-unsafe-limited @@ -1,18 +1,23 @@ Description: Return current locale's name, according to glibc naming conventions, in thread-local (unsafe) storage. -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/localename.h lib/localename-unsafe.c m4/localename.m4 m4/intl-thread-locale.m4 +m4/intlmacosx.m4 m4/lcmessage.m4 +m4/musl.m4 Depends-on: +localename-environ extensions locale-h +strdup +windows-mutex getlocalename_l-unsafe-limited setlocale-null-unlocked @@ -20,7 +25,8 @@ configure.ac: gl_LOCALENAME_UNSAFE_LIMITED AC_REQUIRE([AC_CANONICAL_HOST]) gl_CONDITIONAL([GL_COND_OBJ_LOCALENAME_UNSAFE_LIMITED], - [case "$host_os" in netbsd* | solaris*) true;; *) false;; esac]) + [case "$host_os" in openbsd* | aix* | *-android*) false;; *) true;; esac]) +gl_MUSL_LIBC Makefile.am: if GL_COND_OBJ_LOCALENAME_UNSAFE_LIMITED @@ -31,6 +37,7 @@ Include: "localename.h" Link: +@INTL_MACOSX_LIBS@ $(LIBTHREAD) License:
