diff options
Diffstat (limited to 'newlib/libc/include/ctype.h')
-rw-r--r-- | newlib/libc/include/ctype.h | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/newlib/libc/include/ctype.h b/newlib/libc/include/ctype.h index 17a486ebb..c1ace5077 100644 --- a/newlib/libc/include/ctype.h +++ b/newlib/libc/include/ctype.h @@ -36,20 +36,21 @@ int _EXFUN(_toupper, (int __c)); #define _X 0100 #define _B 0200 -extern __IMPORT _CONST char *__ctype_ptr__; +extern __IMPORT _CONST char *__ctype_ptr; +extern __IMPORT _CONST char _ctype_[]; /* For backward compatibility. */ #ifndef __cplusplus -#define isalpha(c) ((__ctype_ptr__)[(unsigned)((c)+1)]&(_U|_L)) -#define isupper(c) ((__ctype_ptr__)[(unsigned)((c)+1)]&_U) -#define islower(c) ((__ctype_ptr__)[(unsigned)((c)+1)]&_L) -#define isdigit(c) ((__ctype_ptr__)[(unsigned)((c)+1)]&_N) -#define isxdigit(c) ((__ctype_ptr__)[(unsigned)((c)+1)]&(_X|_N)) -#define isspace(c) ((__ctype_ptr__)[(unsigned)((c)+1)]&_S) -#define ispunct(c) ((__ctype_ptr__)[(unsigned)((c)+1)]&_P) -#define isalnum(c) ((__ctype_ptr__)[(unsigned)((c)+1)]&(_U|_L|_N)) -#define isprint(c) ((__ctype_ptr__)[(unsigned)((c)+1)]&(_P|_U|_L|_N|_B)) -#define isgraph(c) ((__ctype_ptr__)[(unsigned)((c)+1)]&(_P|_U|_L|_N)) -#define iscntrl(c) ((__ctype_ptr__)[(unsigned)((c)+1)]&_C) +#define isalpha(c) ((__ctype_ptr)[(unsigned)(c)]&(_U|_L)) +#define isupper(c) ((__ctype_ptr)[(unsigned)(c)]&_U) +#define islower(c) ((__ctype_ptr)[(unsigned)(c)]&_L) +#define isdigit(c) ((__ctype_ptr)[(unsigned)(c)]&_N) +#define isxdigit(c) ((__ctype_ptr)[(unsigned)(c)]&(_X|_N)) +#define isspace(c) ((__ctype_ptr)[(unsigned)(c)]&_S) +#define ispunct(c) ((__ctype_ptr)[(unsigned)(c)]&_P) +#define isalnum(c) ((__ctype_ptr)[(unsigned)(c)]&(_U|_L|_N)) +#define isprint(c) ((__ctype_ptr)[(unsigned)(c)]&(_P|_U|_L|_N|_B)) +#define isgraph(c) ((__ctype_ptr)[(unsigned)(c)]&(_P|_U|_L|_N)) +#define iscntrl(c) ((__ctype_ptr)[(unsigned)(c)]&_C) /* Non-gcc versions will get the library versions, and will be @@ -67,9 +68,6 @@ extern __IMPORT _CONST char *__ctype_ptr__; #define toascii(c) ((c)&0177) #endif -/* For C++ backward-compatibility only. */ -extern __IMPORT _CONST char _ctype_[]; - _END_STD_C #endif /* _CTYPE_H_ */ |