Hash :
bc2d70ee
Author :
Date :
2025-02-14T15:24:54
newlocale: Work around macOS, NetBSD, Solaris 11 OpenIndiana bug. * m4/newlocale.m4 (gl_FUNC_NEWLOCALE): Test for the "null base" bug. Set REPLACE_NEWLOCALE to 1 if it has the bug. * lib/newlocale.c (newlocale): Add alternative implementation that uses the system's newlocale(). * modules/newlocale (configure.ac): Consider REPLACE_NEWLOCALE. * tests/test-newlocale.c: Include <langinfo.h>. (main): Verify fix for the "null base" bug. * modules/newlocale-tests (configure.ac): Test for nl_langinfo_l. * doc/posix-functions/newlocale.texi: Mention the "null base" bug.
@node newlocale
@subsection @code{newlocale}
@findex newlocale
POSIX specification:@* @url{https://pubs.opengroup.org/onlinepubs/9799919799/functions/newlocale.html}
Gnulib module: newlocale
@mindex newlocale
Portability problems fixed by Gnulib:
@itemize
@item
This function is missing on many platforms:
FreeBSD 9.0, NetBSD 6.1, OpenBSD 6.1, Minix 3.1.8, AIX 6.1, HP-UX 11, Solaris 11.3, Cygwin 2.5.x, mingw, MSVC 14, Android 4.4.
@item
This function is useless because the @code{locale_t} type is not defined
on some platforms:
z/OS.
@item
When the third argument is NULL, this function uses locale category data
from the current locale instead of from the "C" locale on some platforms:
macOS, NetBSD 10.0, Solaris 11 OpenIndiana.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@item
This function is useless because the @code{locale_t} type contains basically
no information on some platforms:
OpenBSD 6.3.
@end itemize