Hash :
a5ce928d
Author :
Date :
2025-02-14T05:56:55
duplocale: Support all platforms. * lib/locale.in.h (duplocale): Declare also on platforms that don't already have a duplocale function. Don't define HAVE_WORKING_DUPLOCALE. * lib/duplocale.c: Include <stdlib.h>. (duplocale): Renamed from rpl_duplocale. Add implementation for platforms without native locale_t. * modules/duplocale (Depends-on): Add newlocale, freelocale. (configure.ac): Compile also on platforms without native locale_t. * tests/test-duplocale.c: Ignore HAVE_WORKING_DUPLOCALE. * tests/test-locale-h-c++.cc: Likewise. * doc/posix-functions/duplocale.texi: Mention the change.
@node duplocale
@subsection @code{duplocale}
@findex duplocale
POSIX specification:@* @url{https://pubs.opengroup.org/onlinepubs/9799919799/functions/duplocale.html}
Gnulib module: duplocale
@mindex duplocale
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
The argument @code{LC_GLOBAL_LOCALE} is not supported on some platforms:
glibc 2.11, AIX 7.1.
@item
With the argument @code{LC_GLOBAL_LOCALE}, this function returns a wrong result
on some platforms:
NetBSD 7.1.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
@item
With the argument @code{LC_GLOBAL_LOCALE}, this function returns a wrong result
on some platforms:
@c https://dev.haiku-os.org/ticket/18345
Haiku.
@end itemize