aboutsummaryrefslogtreecommitdiff
path: root/locale
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2002-08-29 02:18:11 +0000
committerRoland McGrath <roland@gnu.org>2002-08-29 02:18:11 +0000
commit963e3b588003bafb2529e4a989211b0ecc39c684 (patch)
tree6dda3798c6bc7bf9323a7e2d9ebad08c0fc8a06b /locale
parent45061a153c431bb3127d2a3c7fbb6abfbec0a505 (diff)
downloadglibc-963e3b588003bafb2529e4a989211b0ecc39c684.tar
glibc-963e3b588003bafb2529e4a989211b0ecc39c684.tar.gz
glibc-963e3b588003bafb2529e4a989211b0ecc39c684.tar.bz2
glibc-963e3b588003bafb2529e4a989211b0ecc39c684.zip
* locale/nl_langinfo.c [NL_CURRENT_INDIRECT]: Use a categories.def
iterator to refer to each category's _nl_current_LC_FOO symbol, so we know they are all linked in.
Diffstat (limited to 'locale')
-rw-r--r--locale/nl_langinfo.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/locale/nl_langinfo.c b/locale/nl_langinfo.c
index 7df2b30ba9..2314b80f0f 100644
--- a/locale/nl_langinfo.c
+++ b/locale/nl_langinfo.c
@@ -47,6 +47,18 @@ nl_langinfo (item)
#ifdef USE_IN_EXTENDED_LOCALE_MODEL
data = l->__locales[category];
+#elif defined NL_CURRENT_INDIRECT
+ /* Make direct reference to every _nl_current_CATEGORY symbol,
+ since we know only at runtime which categories are used. */
+ switch (category)
+ {
+# define DEFINE_CATEGORY(category, category_name, items, a) \
+ case category: data = *_nl_current_##category; break;
+# include "categories.def"
+# undef DEFINE_CATEGORY
+ default: /* Should be impossible. */
+ return (char *) "";
+ }
#else
data = _NL_CURRENT_DATA (category);
#endif