Update for new LC_CTYPE data.
authordrepper <drepper>
Tue, 31 Aug 1999 07:02:46 +0000 (07:02 +0000)
committerdrepper <drepper>
Tue, 31 Aug 1999 07:02:46 +0000 (07:02 +0000)
wctype/cname-lookup.h

index 77186d4..ffe677b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1996.
 
@@ -37,23 +37,35 @@ cname_lookup (wint_t wc, __locale_t locale)
 
 #ifndef USE_IN_EXTENDED_LOCALE_MODEL
   extern unsigned int *__ctype_names;
-  hash_size = _NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_HASH_SIZE);
-  hash_layers = _NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_HASH_LAYERS);
+# if BYTE_ORDER == BIG_ENDIAN
+  hash_size = _NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_HASH_SIZE_EB);
+  hash_layers = _NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_HASH_LAYERS_EB);
+# elif BYTE_ORDER == LITTLE_ENDIAN
+  hash_size = _NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_HASH_SIZE_EL);
+  hash_layers = _NL_CURRENT_WORD (LC_CTYPE, _NL_CTYPE_HASH_LAYERS_EL);
+# else
+#  error bizarre byte order
+# endif
+
 #else
   struct locale_data *current = locale->__locales[LC_CTYPE];
-#if BYTE_ORDER == BIG_ENDIAN
+# if BYTE_ORDER == BIG_ENDIAN
   unsigned int *__ctype_names =
     (unsigned int *) current->values[_NL_ITEM_INDEX (_NL_CTYPE_NAMES_EB)].string;
-#elif BYTE_ORDER == LITTLE_ENDIAN
+  hash_size =
+    current->values[_NL_ITEM_INDEX (_NL_CTYPE_HASH_SIZE_EB)].word;
+  hash_layers =
+    current->values[_NL_ITEM_INDEX (_NL_CTYPE_HASH_LAYERS_EB)].word;
+# elif BYTE_ORDER == LITTLE_ENDIAN
   unsigned int *__ctype_names =
     (unsigned int *) current->values[_NL_ITEM_INDEX (_NL_CTYPE_NAMES_EL)].string;
-#else
-# error bizarre byte order
-#endif
   hash_size =
-    current->values[_NL_ITEM_INDEX (_NL_CTYPE_HASH_SIZE)].word;
+    current->values[_NL_ITEM_INDEX (_NL_CTYPE_HASH_SIZE_EL)].word;
   hash_layers =
-    current->values[_NL_ITEM_INDEX (_NL_CTYPE_HASH_LAYERS)].word;
+    current->values[_NL_ITEM_INDEX (_NL_CTYPE_HASH_LAYERS_EL)].word;
+# else
+#  error bizarre byte order
+# endif
 #endif
 
   result = wc % hash_size;