From: Bruno Haible Date: Sat, 30 Sep 2023 18:21:52 +0000 (+0200) Subject: intl: Merge from glibc. X-Git-Tag: v0.23~352 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cea20198861963c94c3fdbf834fae46816920094;p=thirdparty%2Fgettext.git intl: Merge from glibc. Apply commit 2017-08-15 Florian Weimer iconv, intl, locale, wcsmbs: Remove internal_function --- diff --git a/gettext-runtime/intl/dcigettext.c b/gettext-runtime/intl/dcigettext.c index 242dd5192..a90b509bd 100644 --- a/gettext-runtime/intl/dcigettext.c +++ b/gettext-runtime/intl/dcigettext.c @@ -316,18 +316,15 @@ struct binding *_nl_domain_bindings; /* Prototypes for local functions. */ static char *plural_lookup (struct loaded_l10nfile *domain, unsigned long int n, - const char *translation, size_t translation_len) - internal_function; + const char *translation, size_t translation_len); #ifdef IN_LIBGLOCALE static const char *guess_category_value (int category, const char *categoryname, - const char *localename) - internal_function; + const char *localename); #else static const char *guess_category_value (int category, - const char *categoryname) - internal_function; + const char *categoryname); #endif #ifdef _LIBC @@ -335,11 +332,10 @@ static const char *guess_category_value (int category, # define category_to_name(category) \ _nl_category_names.str + _nl_category_name_idxs[category] #else -static const char *category_to_name (int category) internal_function; +static const char *category_to_name (int category); #endif #if (defined _LIBC || HAVE_ICONV) && !defined IN_LIBGLOCALE -static const char *get_output_charset (struct binding *domainbinding) - internal_function; +static const char *get_output_charset (struct binding *domainbinding); #endif @@ -932,7 +928,6 @@ __libc_lock_define_initialized (static, lock) in case of a memory allocation failure during conversion (only if ENCODING != NULL resp. CONVERT == true). */ char * -internal_function #ifdef IN_LIBGLOCALE _nl_find_msg (struct loaded_l10nfile *domain_file, struct binding *domainbinding, const char *encoding, @@ -1462,7 +1457,6 @@ _nl_find_msg (struct loaded_l10nfile *domain_file, /* Look up a plural variant. */ static char * -internal_function plural_lookup (struct loaded_l10nfile *domain, unsigned long int n, const char *translation, size_t translation_len) { @@ -1500,7 +1494,6 @@ plural_lookup (struct loaded_l10nfile *domain, unsigned long int n, #ifndef _LIBC /* Return string representation of locale CATEGORY. */ static const char * -internal_function category_to_name (int category) { const char *retval; @@ -1562,7 +1555,6 @@ category_to_name (int category) This uses values of the environment variables LC_ALL, LC_*, LANG, LANGUAGE, and/or system-dependent defaults. */ static const char * -internal_function #ifdef IN_LIBGLOCALE guess_category_value (int category, const char *categoryname, const char *locale) @@ -1657,7 +1649,6 @@ guess_category_value (int category, const char *categoryname) #if (defined _LIBC || HAVE_ICONV) && !defined IN_LIBGLOCALE /* Returns the output charset. */ static const char * -internal_function get_output_charset (struct binding *domainbinding) { /* The output charset should normally be determined by the locale. But diff --git a/gettext-runtime/intl/eval-plural.h b/gettext-runtime/intl/eval-plural.h index df35866c7..38413c4d4 100644 --- a/gettext-runtime/intl/eval-plural.h +++ b/gettext-runtime/intl/eval-plural.h @@ -1,5 +1,5 @@ /* Plural expression evaluation. - Copyright (C) 2000-2003, 2007 Free Software Foundation, Inc. + Copyright (C) 2000-2023 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -21,7 +21,6 @@ /* Evaluate the plural expression and return an index value. */ STATIC unsigned long int -internal_function plural_eval (const struct expression *pexp, unsigned long int n) { switch (pexp->nargs) diff --git a/gettext-runtime/intl/finddomain.c b/gettext-runtime/intl/finddomain.c index 59e7463de..2a40df011 100644 --- a/gettext-runtime/intl/finddomain.c +++ b/gettext-runtime/intl/finddomain.c @@ -62,7 +62,6 @@ gl_rwlock_define_initialized (static, lock); the DIRNAME or WDIRNAME, LOCALE, and DOMAINNAME parameters with respect to the currently established bindings. */ struct loaded_l10nfile * -internal_function _nl_find_domain (const char *dirname, #if defined _WIN32 && !defined __CYGWIN__ const wchar_t *wdirname, diff --git a/gettext-runtime/intl/gettextP.h b/gettext-runtime/intl/gettextP.h index 58576ff4c..5c21505db 100644 --- a/gettext-runtime/intl/gettextP.h +++ b/gettext-runtime/intl/gettextP.h @@ -61,7 +61,7 @@ extern char *__bind_textdomain_codeset (const char *__domainname, const char *__codeset); extern void _nl_finddomain_subfreeres (void) attribute_hidden; extern void _nl_unload_domain (struct loaded_domain *__domain) - internal_function attribute_hidden; + attribute_hidden; #else /* Declare the exported libintl_* functions, in a way that allows us to call them under their real name. */ @@ -89,10 +89,6 @@ extern char *libintl_dcigettext (const char *__domainname, /* @@ end of prolog @@ */ -#ifndef internal_function -# define internal_function -#endif - #ifndef attribute_hidden # define attribute_hidden #endif @@ -242,23 +238,19 @@ struct loaded_l10nfile *_nl_find_domain (const char *__dirname, #endif char *__locale, const char *__domainname, - struct binding *__domainbinding) - internal_function; + struct binding *__domainbinding); void _nl_load_domain (struct loaded_l10nfile *__domain, - struct binding *__domainbinding) - internal_function; + struct binding *__domainbinding); #ifdef IN_LIBGLOCALE char *_nl_find_msg (struct loaded_l10nfile *domain_file, struct binding *domainbinding, const char *encoding, const char *msgid, - size_t *lengthp) - internal_function; + size_t *lengthp); #else char *_nl_find_msg (struct loaded_l10nfile *domain_file, struct binding *domainbinding, const char *msgid, - int convert, size_t *lengthp) - internal_function; + int convert, size_t *lengthp); #endif /* The internal variables in the standalone libintl.a must have different diff --git a/gettext-runtime/intl/loadinfo.h b/gettext-runtime/intl/loadinfo.h index a15436253..caa8d0f46 100644 --- a/gettext-runtime/intl/loadinfo.h +++ b/gettext-runtime/intl/loadinfo.h @@ -30,10 +30,6 @@ in gettextP.h. */ -#ifndef internal_function -# define internal_function -#endif - #ifndef LIBINTL_SHLIB_EXPORTED # define LIBINTL_SHLIB_EXPORTED #endif diff --git a/gettext-runtime/intl/loadmsgcat.c b/gettext-runtime/intl/loadmsgcat.c index 60b437348..a8cf94c4a 100644 --- a/gettext-runtime/intl/loadmsgcat.c +++ b/gettext-runtime/intl/loadmsgcat.c @@ -679,7 +679,6 @@ __libc_lock_define_initialized_recursive (static, lock); /* Load the message catalogs specified by FILENAME. If it is no valid message catalog do nothing. */ void -internal_function _nl_load_domain (struct loaded_l10nfile *domain_file, struct binding *domainbinding) { @@ -1256,7 +1255,7 @@ _nl_load_domain (struct loaded_l10nfile *domain_file, #ifdef _LIBC void -internal_function __libc_freeres_fn_section +__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 18c204a33..0b499e3bd 100644 --- a/gettext-runtime/intl/localealias.c +++ b/gettext-runtime/intl/localealias.c @@ -107,10 +107,6 @@ char *alloca (); # include "glthread/lock.h" #endif -#ifndef internal_function -# define internal_function -#endif - /* Some optimizations for glibc. */ #ifdef _LIBC # define FEOF(fp) feof_unlocked (fp) @@ -180,8 +176,7 @@ static size_t maxmap; /* Prototypes for local functions. */ -static size_t read_alias_file (const char *fname, int fname_len) - internal_function; +static size_t read_alias_file (const char *fname, int fname_len); static int extend_alias_table (void); static int alias_compare (const struct alias_map *map1, const struct alias_map *map2); @@ -262,7 +257,6 @@ _nl_expand_alias (const char *name) # endif static size_t -internal_function read_alias_file (const char *fname, int fname_len) { FILE *fp; diff --git a/gettext-runtime/intl/plural-exp.c b/gettext-runtime/intl/plural-exp.c index 6bff9a212..47cf2d56d 100644 --- a/gettext-runtime/intl/plural-exp.c +++ b/gettext-runtime/intl/plural-exp.c @@ -56,7 +56,6 @@ const struct expression GERMANIC_PLURAL = }; void -internal_function EXTRACT_PLURAL_EXPRESSION (const char *nullentry, const struct expression **pluralp, unsigned long int *npluralsp) diff --git a/gettext-runtime/intl/plural-exp.h b/gettext-runtime/intl/plural-exp.h index c4c7153ad..c00984c0a 100644 --- a/gettext-runtime/intl/plural-exp.h +++ b/gettext-runtime/intl/plural-exp.h @@ -18,10 +18,6 @@ #ifndef _PLURAL_EXP_H #define _PLURAL_EXP_H -#ifndef internal_function -# define internal_function -#endif - #ifndef attribute_hidden # define attribute_hidden #endif @@ -105,14 +101,12 @@ struct parse_args # define EXTRACT_PLURAL_EXPRESSION extract_plural_expression #endif -extern void FREE_EXPRESSION (struct expression *exp) - internal_function; +extern void FREE_EXPRESSION (struct expression *exp); extern int PLURAL_PARSE (struct parse_args *arg); extern const struct expression GERMANIC_PLURAL attribute_hidden; extern void EXTRACT_PLURAL_EXPRESSION (const char *nullentry, const struct expression **pluralp, - unsigned long int *npluralsp) - internal_function; + unsigned long int *npluralsp); #if !defined (_LIBC) && !defined (IN_LIBINTL) && !defined (IN_LIBGLOCALE) extern unsigned long int plural_eval (const struct expression *pexp, diff --git a/gettext-runtime/intl/plural.y b/gettext-runtime/intl/plural.y index be78cebf8..858601be0 100644 --- a/gettext-runtime/intl/plural.y +++ b/gettext-runtime/intl/plural.y @@ -1,6 +1,6 @@ %{ /* Expression parsing for plural form selection. - Copyright (C) 2000-2020 Free Software Foundation, Inc. + Copyright (C) 2000-2023 Free Software Foundation, Inc. Written by Ulrich Drepper , 2000. This program is free software: you can redistribute it and/or modify @@ -200,7 +200,6 @@ exp: exp '?' exp ':' exp %% void -internal_function FREE_EXPRESSION (struct expression *exp) { if (exp == NULL)