diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2005-03-17 23:11:23 +0300 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2005-03-17 23:11:23 +0300 |
commit | dd801fdabd7e6d80e69cbde473b723a6ef7cff86 (patch) | |
tree | 6927d01de5dcee48cb0966fd11a634b4ba399195 /newlib/libc/include/ctype.h | |
parent | 993317d0ed9a7bee9b461e63a762b6df249ef867 (diff) |
2005-03-17 Jeff Johnston <jjohnstn@redhat.com>
* 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.
Diffstat (limited to 'newlib/libc/include/ctype.h')
-rw-r--r-- | newlib/libc/include/ctype.h | 27 |
1 files changed, 15 insertions, 12 deletions
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__ |