perf tools: Implement islower/isupper macro into util.h

The util.h header provides various ctype macros but lacks those two.

Add them.

Cc: Ingo Molnar <mingo@elte.hu>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1328836217-9118-1-git-send-email-namhyung.kim@lge.com
Signed-off-by: Namhyung Kim <namhyung.kim@lge.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Namhyung Kim 2012-02-10 10:10:15 +09:00 committed by Arnaldo Carvalho de Melo
parent c4a7dca92b
commit 2cd13b0f7d
1 changed files with 4 additions and 0 deletions

View File

@ -199,6 +199,8 @@ static inline int has_extension(const char *filename, const char *ext)
#undef isalpha #undef isalpha
#undef isprint #undef isprint
#undef isalnum #undef isalnum
#undef islower
#undef isupper
#undef tolower #undef tolower
#undef toupper #undef toupper
@ -219,6 +221,8 @@ extern unsigned char sane_ctype[256];
#define isalpha(x) sane_istest(x,GIT_ALPHA) #define isalpha(x) sane_istest(x,GIT_ALPHA)
#define isalnum(x) sane_istest(x,GIT_ALPHA | GIT_DIGIT) #define isalnum(x) sane_istest(x,GIT_ALPHA | GIT_DIGIT)
#define isprint(x) sane_istest(x,GIT_PRINT) #define isprint(x) sane_istest(x,GIT_PRINT)
#define islower(x) (sane_istest(x,GIT_ALPHA) && sane_istest(x,0x20))
#define isupper(x) (sane_istest(x,GIT_ALPHA) && !sane_istest(x,0x20))
#define tolower(x) sane_case((unsigned char)(x), 0x20) #define tolower(x) sane_case((unsigned char)(x), 0x20)
#define toupper(x) sane_case((unsigned char)(x), 0) #define toupper(x) sane_case((unsigned char)(x), 0)