mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-18 12:29:32 +08:00
ca3e3bc54e
Provide an extension NL_LOCALE_NAME() macro, with semantics matching glibc, which can be used as: nl_langinfo_l(NL_LOCALE_NAME(LC_MESSAGES), locale); to get back the locale string that locale was originally created with during newlocale(). This in turn allows a library (such as gettext) to determine what thread-local locale settings it has inherited from the main program without having to be told what parameters were passed to newlocale(), for less overall coupling between parts of the program. gnulib is set up to use the extension: https://lists.gnu.org/archive/html/bug-gnulib/2017-01/msg00129.html * libc/include/langinfo.h (NL_LOCALE_NAME): New macro * libc/locale/nl_langinfo.c (nl_langinfo_l): Expose locale names of a locale_t's category components. Signed-off-by: Eric Blake <eblake@redhat.com>