From c67356287c51d3c8157eaf05b74d9f35bbbbef6c Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Fri, 14 Oct 1994 02:17:17 +0000 Subject: [PATCH] [HAVE__LOCP]: Move this defn to first. Include sys/types.h. --- sysdeps/unix/common/glue-ctype.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/sysdeps/unix/common/glue-ctype.c b/sysdeps/unix/common/glue-ctype.c index 73ac417ac9..d2d645b5b0 100644 --- a/sysdeps/unix/common/glue-ctype.c +++ b/sysdeps/unix/common/glue-ctype.c @@ -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 /* for wchar_t used by localdef.h */ +#include +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 -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 "); #ifdef TABLE_NAME