]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
[HAVE__LOCP]: Move this defn to first. Include sys/types.h.
authorRoland McGrath <roland@gnu.org>
Fri, 14 Oct 1994 02:17:17 +0000 (02:17 +0000)
committerRoland McGrath <roland@gnu.org>
Fri, 14 Oct 1994 02:17:17 +0000 (02:17 +0000)
sysdeps/unix/common/glue-ctype.c

index 73ac417ac99c5d13fc7e0284b89aefaada504179..d2d645b5b050dc2dbe6abd10c045e1b494c8637f 100644 (file)
@@ -18,6 +18,19 @@ Cambridge, MA 02139, USA.  */
 
 /* Different systems have different names for the array.
    This order is important for some systems.  */
+
+#if !defined(TABLE) && defined(HAVE__LOCP)
+/* OSF/1 has the name _ctype defined as a macro, which points down into
+   the _locp structure.  Jesus.  We'll hope this works.  We need to
+   check for LOCP first, since there is no symbol actually named _ctype
+   in their library.  */
+#include <sys/types.h> /* for wchar_t used by localdef.h */
+#include <sys/localedef.h>
+extern loc_t *_locp;
+#define TABLE          (_locp->lc_chrtbl)->lc_ctype
+#undef _ctype
+#define TABLE_NAME     _ctype
+#endif
 #ifdef HAVE__CTYPE__
 #define        TABLE   _ctype__
 #endif
@@ -33,15 +46,6 @@ Cambridge, MA 02139, USA.  */
 #if !defined(TABLE) && defined(HAVE___CTYPE)
 #define        TABLE   __ctype
 #endif
-#if !defined(TABLE) && defined(HAVE__LOCP)
-/* OSF/1 has the name _ctype defined as a macro, which points down into
-   the _locp structure.  Jesus.  We'll hope this works.  */
-#include <sys/localedef.h>
-extern loc_t *_locp;
-#define TABLE          (_locp->lc_chrtbl)->lc_ctype
-#undef _ctype
-#define TABLE_NAME     _ctype
-#endif
 
 #if defined (__STDC__) && __STDC__
 #define        STRINGIFY(arg)  #arg
@@ -57,7 +61,10 @@ main ()
 
   int i;
 
+#ifndef HAVE__LOCP
+  /* This won't work for the define to look into _locp.  */
   extern unsigned char TABLE[];
+#endif
 
   puts ("#include <ansidecl.h>");
 #ifdef TABLE_NAME