From a29a76934280b14aa7f13bbb3e86b1a8a2bcdfb7 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 9 Apr 2009 10:37:58 +0000 Subject: * libc/ctype/ctype_.c (_CTYPE_DATA_0_127): Remove _B flag from TAB. * libc/ctype/ctype_cp.h: Mark non-cased letters in tables for codepages 720, 862, 874, 1255, and 1256 to _U|_L. Fix a couple of incorrect class mappings. * libc/ctype/ctype_iso.h: Mark non-cased letters in ISO-8859 tables 6, 8, and 11 to _U|_L. Fix a couple of incorrect class mappings. * libc/ctype/isblank.c (isblank): Special case TAB. * libc/ctype/islower.c (islower): Check explicitely for _L flag only in (_U|_L). * libc/ctype/isupper.c (isupper): Ditto, but check for _U flag. * libc/include/ctype.h (islower): Same in macro. (isupper): Ditto. (isblank): Special case TAB. Redefine macro for GCC only. --- newlib/libc/include/ctype.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'newlib/libc/include') diff --git a/newlib/libc/include/ctype.h b/newlib/libc/include/ctype.h index d223dd09a..c2e393b31 100644 --- a/newlib/libc/include/ctype.h +++ b/newlib/libc/include/ctype.h @@ -46,8 +46,8 @@ extern __IMPORT char *__ctype_ptr__; #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 isupper(c) (((__ctype_ptr__)[(unsigned)((c)+1)]&(_U|_L))==_U) +#define islower(c) (((__ctype_ptr__)[(unsigned)((c)+1)]&(_U|_L))==_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) @@ -57,8 +57,10 @@ extern __IMPORT char *__ctype_ptr__; #define isgraph(c) ((__ctype_ptr__)[(unsigned)((c)+1)]&(_P|_U|_L|_N)) #define iscntrl(c) ((__ctype_ptr__)[(unsigned)((c)+1)]&_C) -#if !defined(__STRICT_ANSI__) || __STDC_VERSION__ >= 199901L -#define isblank(c) ((__ctype_ptr__)[(unsigned)((c)+1)]&_B) +#if defined(__GNUC__) && \ + (!defined(__STRICT_ANSI__) || __STDC_VERSION__ >= 199901L) +#define isblank(c) \ + __extension__ ({ int __c = (c); ((__ctype_ptr__)[(unsigned)((__c)+1)]&_B) || (__c) == '\t';}) #endif -- cgit v1.2.3