]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
intl: Merge from glibc.
authorBruno Haible <bruno@clisp.org>
Sat, 30 Sep 2023 19:07:15 +0000 (21:07 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 30 Sep 2023 22:36:55 +0000 (00:36 +0200)
Apply commit
2022-12-27  Adhemerval Zanella Netto  <adhemerval.zanella@linaro.org>
Move libc_freeres_ptrs and libc_subfreeres to hidden/weak functions

gettext-runtime/intl/dcigettext.c
gettext-runtime/intl/finddomain.c
gettext-runtime/intl/loadmsgcat.c
gettext-runtime/intl/localealias.c

index de1008475e455bff1e6bd3875f2ecde696dfb107..f1cb79db79ca3cff48a5e16e0f7fec9cc23e937d 100644 (file)
@@ -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;
 
index 2a40df011dbf649b2e00d61bddde255ba04b6254..123189cad4be1e5a9c2d9ff28ebb62927f484510 100644 (file)
@@ -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;
index 7bb6a73096286ebe8e5a3d6f208823b4d0cd3515..6b23498cd27d7933ed5e110be8bd30ae75bb566a 100644 (file)
@@ -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;
index 3953312c54a2f38cfa887bc965613d69b4e290b2..eb789433df92c1e495cde58b79cda99c67379756 100644 (file)
@@ -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