diff options
author | Rich Felker <dalias@aerifal.cx> | 2011-02-14 18:41:25 -0500 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2011-02-14 18:41:25 -0500 |
commit | 74eea628cf43355ba2b227f0bb3c31697d637761 (patch) | |
tree | 9fe300db7b7fa7f541bdfa41176d0f6333851e74 /include/ctype.h | |
parent | 80695b1d1e64a026c473a33965e680444e863e34 (diff) | |
download | musl-74eea628cf43355ba2b227f0bb3c31697d637761.tar.gz musl-74eea628cf43355ba2b227f0bb3c31697d637761.tar.bz2 musl-74eea628cf43355ba2b227f0bb3c31697d637761.tar.xz musl-74eea628cf43355ba2b227f0bb3c31697d637761.zip |
extensive header cleanup for standards conformance & correctness
thanks to Peter Mazinger (psm) for pointing many of these issues out
and submitting a patch on which this commit is loosely based
Diffstat (limited to 'include/ctype.h')
-rw-r--r-- | include/ctype.h | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/include/ctype.h b/include/ctype.h index 02f81fa7..97b9737c 100644 --- a/include/ctype.h +++ b/include/ctype.h @@ -16,12 +16,6 @@ int isxdigit(int); int tolower(int); int toupper(int); -int isascii(int); -int toascii(int); - -#define _tolower(a) ((a)|0x20) -#define _toupper(a) ((a)&0x5f) - #define isalpha(a) ((unsigned)(((a)|32)-'a') < 26) #define isdigit(a) ((unsigned)((a)-'0') < 10) #define islower(a) ((unsigned)((a)-'a') < 26) @@ -29,7 +23,10 @@ int toascii(int); #define isprint(a) ((unsigned)((a)-0x20) < 0x5f) #define isgraph(a) ((unsigned)((a)-0x21) < 0x5e) -#if 1 + + +#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ + || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) #define __NEED_locale_t #include <bits/alltypes.h> @@ -48,6 +45,12 @@ int isupper_l(int, locale_t); int isxdigit_l(int, locale_t); int tolower_l(int, locale_t); int toupper_l(int, locale_t); + +int isascii(int); +int toascii(int); +#define _tolower(a) ((a)|0x20) +#define _toupper(a) ((a)&0x5f) + #endif #endif |