Hash :
706178a9
Author :
Date :
2025-02-21T11:25:51
getlocalename_l-simple: New module. * lib/locale.in.h (newlocale, duplocale, freelocale): Now enabled by module 'getlocalename_l-simple'. (getlocalename_l): New declaration. * lib/getlocalename_l.c: New file, based on lib/localename-unsafe.c, with modifications for glibc systems, NetBSD, OpenBSD, Android. * lib/localename-table.h (LCMIN): New macro. * lib/struniq.h: Update a comment. * lib/localename-unsafe.c: Don't define the LOCALENAME_ENHANCE_LOCALE_FUNCS overrides here. Moved to lib/getlocalename_l.c. (gl_locale_name_thread_unsafe): Invoke getlocalename_l. Previous code moved to lib/getlocalename_l.c. * m4/intl-thread-locale.m4 (gt_INTL_THREAD_LOCALE_NAME): Improve support for OpenBSD: Set gt_nameless_locales to yes and gt_localename_enhances_locale_funcs to yes also when $gt_fake_locales is yes. * m4/getlocalename_l.m4: New file, based on m4/localename.m4. * m4/localename.m4 (gl_LOCALENAME_UNSAFE, gl_LOCALENAME_UNSAFE_LIMITED): Remove code that was moved to m4/getlocalename_l.m4. * m4/locale_h.m4 (gl_LOCALE_H): Test whether getlocalename_l is declared. (gl_LOCALE_H_REQUIRE_DEFAULTS): Initialize GNULIB_GETLOCALENAME_L. (gl_LOCALE_H_DEFAULTS): Initialize HAVE_GETLOCALENAME_L. * modules/locale-h (Makefile.am): Substitute GNULIB_GETLOCALENAME_L, HAVE_GETLOCALENAME_L. * modules/getlocalename_l-simple: New file. * modules/localename-unsafe (Files): Remove lib/localename-table.h, lib/localename-table.c, lib/struniq.h. (Depends-on): Add getlocalename_l-simple. Remove bool, flexmember, free-posix, langinfo-h, thread-optim. (Makefile.am): Don't compile localename-table.c. * modules/localename-unsafe-limited (Depends-on): Add getlocalename_l-simple. * modules/newlocale (Link): New section. * modules/duplocale (Link): Link with $(GETLOCALENAME_L_LIB). * modules/freelocale (Link): New section. * modules/newlocale-tests (Makefile.am): Link the test program with $(GETLOCALENAME_L_LIB). * modules/duplocale-tests (Makefile.am): Likewise. * modules/freelocale-tests (Makefile.am): Likewise. * modules/is*_l-tests (Makefile.am): Likewise. * modules/tolower_l-tests (Makefile.am): Likewise. * modules/toupper_l-tests (Makefile.am): Likewise. * modules/strcasecmp_l-tests (Makefile.am): Likewise. * modules/strncasecmp_l-tests (Makefile.am): Likewise. * modules/strerror_l-tests (Makefile.am): Likewise. * doc/posix-functions/getlocalename_l.texi: Mention the new module.
Description:
newlocale() function: create a locale object.
Files:
lib/newlocale.c
m4/newlocale.m4
Depends-on:
locale-h
localename-environ
configure.ac:
gl_FUNC_NEWLOCALE
gl_CONDITIONAL([GL_COND_OBJ_NEWLOCALE],
[test $HAVE_LOCALE_T = 0 || { test $REPLACE_NEWLOCALE = 1 && test "$gt_localename_enhances_locale_funcs" != yes; }])
AM_COND_IF([GL_COND_OBJ_NEWLOCALE], [
gl_PREREQ_NEWLOCALE
])
gl_LOCALE_MODULE_INDICATOR([newlocale])
Makefile.am:
if GL_COND_OBJ_NEWLOCALE
lib_SOURCES += newlocale.c
endif
Include:
<locale.h>
Link:
$(GETLOCALENAME_L_LIB)
License:
LGPLv2+
Maintainer:
all