From 4195cbfd63af1d488c06f7daa68fea8ae82a4e53 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 4 May 2025 18:25:53 +0200 Subject: [PATCH] getlocalename_l-unsafe: Improve support for Solaris 11 OpenIndiana. Suggested by Andy Fiddaman in . * lib/getlocalename_l-unsafe.c (getlocalename_l_unsafe): On Solaris, use the system's getlocalename_l() function if available. --- ChangeLog | 8 ++++++++ lib/getlocalename_l-unsafe.c | 11 +++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index e43a5efbe7..6a0b2a1361 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2025-05-04 Bruno Haible + + getlocalename_l-unsafe: Improve support for Solaris 11 OpenIndiana. + Suggested by Andy Fiddaman in + . + * lib/getlocalename_l-unsafe.c (getlocalename_l_unsafe): On Solaris, use + the system's getlocalename_l() function if available. + 2025-05-04 Bruno Haible vc-mtime: Don't crash if xgetcwd() returns NULL. diff --git a/lib/getlocalename_l-unsafe.c b/lib/getlocalename_l-unsafe.c index cb7ae5e5ea..66b2c74726 100644 --- a/lib/getlocalename_l-unsafe.c +++ b/lib/getlocalename_l-unsafe.c @@ -550,8 +550,14 @@ getlocalename_l_unsafe (int category, locale_t locale) /* We shouldn't get here. */ return (struct string_with_storage) { "", STORAGE_INDEFINITE }; # else - /* Solaris 11 OpenIndiana. - For the internal structure of locale objects, see + /* Solaris 11 OpenIndiana or Solaris 11 OmniOS. */ +# if HAVE_GETLOCALENAME_L + /* illumos after April 2025. */ +# undef getlocalename_l + const char *name = getlocalename_l (category, locale); + return (struct string_with_storage) { name, STORAGE_OBJECT }; +# else + /* For the internal structure of locale objects, see https://github.com/OpenIndiana/illumos-gate/blob/master/usr/src/lib/libc/port/locale/localeimpl.h */ switch (category) { @@ -568,6 +574,7 @@ getlocalename_l_unsafe (int category, locale_t locale) default: /* We shouldn't get here. */ return (struct string_with_storage) { "", STORAGE_INDEFINITE }; } +# endif # endif #elif HAVE_NAMELESS_LOCALES /* OpenBSD >= 6.2, AIX >= 7.1 */ -- 2.39.5