From: Bruno Haible Date: Sat, 30 Sep 2023 19:07:15 +0000 (+0200) Subject: intl: Merge from glibc. X-Git-Tag: v0.23~336 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4acf46c2197998371988e50242331b7dc0a0f939;p=thirdparty%2Fgettext.git intl: Merge from glibc. Apply commit 2022-12-27 Adhemerval Zanella Netto Move libc_freeres_ptrs and libc_subfreeres to hidden/weak functions --- diff --git a/gettext-runtime/intl/dcigettext.c b/gettext-runtime/intl/dcigettext.c index de1008475..f1cb79db7 100644 --- a/gettext-runtime/intl/dcigettext.c +++ b/gettext-runtime/intl/dcigettext.c @@ -1729,7 +1729,8 @@ mempcpy (void *dest, const void *src, size_t n) #ifdef _LIBC /* If we want to free all resources we have to do some work at program's end. */ -libc_freeres_fn (free_mem) +void +__intl_freemem (void) { void *old; diff --git a/gettext-runtime/intl/finddomain.c b/gettext-runtime/intl/finddomain.c index 2a40df011..123189cad 100644 --- a/gettext-runtime/intl/finddomain.c +++ b/gettext-runtime/intl/finddomain.c @@ -207,7 +207,7 @@ out: #ifdef _LIBC /* This is called from iconv/gconv_db.c's free_mem, as locales must be freed before freeing gconv steps arrays. */ -void __libc_freeres_fn_section +void _nl_finddomain_subfreeres (void) { struct loaded_l10nfile *runp = _nl_loaded_domains; diff --git a/gettext-runtime/intl/loadmsgcat.c b/gettext-runtime/intl/loadmsgcat.c index 7bb6a7309..6b23498cd 100644 --- a/gettext-runtime/intl/loadmsgcat.c +++ b/gettext-runtime/intl/loadmsgcat.c @@ -1255,7 +1255,6 @@ _nl_load_domain (struct loaded_l10nfile *domain_file, #ifdef _LIBC void -__libc_freeres_fn_section _nl_unload_domain (struct loaded_domain *domain) { size_t i; diff --git a/gettext-runtime/intl/localealias.c b/gettext-runtime/intl/localealias.c index 3953312c5..eb789433d 100644 --- a/gettext-runtime/intl/localealias.c +++ b/gettext-runtime/intl/localealias.c @@ -163,14 +163,10 @@ struct alias_map }; -# ifndef _LIBC -# define libc_freeres_ptr(decl) decl -# endif - -libc_freeres_ptr (static char *string_space); +static char *string_space; static size_t string_space_act; static size_t string_space_max; -libc_freeres_ptr (static struct alias_map *map); +static struct alias_map *map; static size_t nmap; static size_t maxmap; @@ -462,4 +458,11 @@ alias_compare (const struct alias_map *map1, const struct alias_map *map2) return strcasecmp (map1->alias, map2->alias); } +void +__libc_localealias_freemem (void) +{ + free (string_space); + free (map); +} + #endif