From dd801fdabd7e6d80e69cbde473b723a6ef7cff86 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Thu, 17 Mar 2005 20:11:23 +0000 Subject: 2005-03-17 Jeff Johnston * configure.in: Add new check to see if compiler supports aliasing of arrays and define _HAVE_ARRAY_ALIASING if true. * configure: Regenerated. * Makefile.in: Ditto. * newlib.hin: Add _HAVE_ARRAY_ALIASING. * libc/ctype/ctype_.c: Check for _HAVE_ARRAY_ALIASING before aliasing the _ctype_ array to _ctype_b. * libc/include/ctype.h: Change macros to use __ctype_ptr. Mark _ctype_ as deprecated. --- newlib/libc/include/ctype.h | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'newlib/libc/include/ctype.h') diff --git a/newlib/libc/include/ctype.h b/newlib/libc/include/ctype.h index a3581df1b..9dccac319 100644 --- a/newlib/libc/include/ctype.h +++ b/newlib/libc/include/ctype.h @@ -36,20 +36,23 @@ int _EXFUN(_toupper, (int __c)); #define _X 0100 #define _B 0200 -extern __IMPORT _CONST char _ctype_[]; +extern __IMPORT _CONST char *__ctype_ptr; #ifndef __cplusplus -#define isalpha(c) ((_ctype_+1)[(unsigned)(c)]&(_U|_L)) -#define isupper(c) ((_ctype_+1)[(unsigned)(c)]&_U) -#define islower(c) ((_ctype_+1)[(unsigned)(c)]&_L) -#define isdigit(c) ((_ctype_+1)[(unsigned)(c)]&_N) -#define isxdigit(c) ((_ctype_+1)[(unsigned)(c)]&(_X|_N)) -#define isspace(c) ((_ctype_+1)[(unsigned)(c)]&_S) -#define ispunct(c) ((_ctype_+1)[(unsigned)(c)]&_P) -#define isalnum(c) ((_ctype_+1)[(unsigned)(c)]&(_U|_L|_N)) -#define isprint(c) ((_ctype_+1)[(unsigned)(c)]&(_P|_U|_L|_N|_B)) -#define isgraph(c) ((_ctype_+1)[(unsigned)(c)]&(_P|_U|_L|_N)) -#define iscntrl(c) ((_ctype_+1)[(unsigned)(c)]&_C) +#define isalpha(c) ((__ctype_ptr+1)[(unsigned)(c)]&(_U|_L)) +#define isupper(c) ((__ctype_ptr+1)[(unsigned)(c)]&_U) +#define islower(c) ((__ctype_ptr+1)[(unsigned)(c)]&_L) +#define isdigit(c) ((__ctype_ptr+1)[(unsigned)(c)]&_N) +#define isxdigit(c) ((__ctype_ptr+1)[(unsigned)(c)]&(_X|_N)) +#define isspace(c) ((__ctype_ptr+1)[(unsigned)(c)]&_S) +#define ispunct(c) ((__ctype_ptr+1)[(unsigned)(c)]&_P) +#define isalnum(c) ((__ctype_ptr+1)[(unsigned)(c)]&(_U|_L|_N)) +#define isprint(c) ((__ctype_ptr+1)[(unsigned)(c)]&(_P|_U|_L|_N|_B)) +#define isgraph(c) ((__ctype_ptr+1)[(unsigned)(c)]&(_P|_U|_L|_N)) +#define iscntrl(c) ((__ctype_ptr+1)[(unsigned)(c)]&_C) + +extern __IMPORT _CONST char _ctype_[]; /* Deprecated. */ + /* Non-gcc versions will get the library versions, and will be slightly slower */ #ifdef __GNUC__ -- cgit v1.2.3