X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=include%2Fctype.h;h=8f0d16872e7a788827564c606867a0e2927d92fd;hp=97b9737cb18343280af09d1e4d54c6b30d63ec45;hb=6d861ac87491a207e4599c44b61d142f0a601c2d;hpb=74eea628cf43355ba2b227f0bb3c31697d637761 diff --git a/include/ctype.h b/include/ctype.h index 97b9737c..8f0d1687 100644 --- a/include/ctype.h +++ b/include/ctype.h @@ -1,6 +1,12 @@ #ifndef _CTYPE_H #define _CTYPE_H +#ifdef __cplusplus +extern "C" { +#endif + +#include + int isalnum(int); int isalpha(int); int isblank(int); @@ -16,17 +22,18 @@ int isxdigit(int); int tolower(int); int toupper(int); -#define isalpha(a) ((unsigned)(((a)|32)-'a') < 26) -#define isdigit(a) ((unsigned)((a)-'0') < 10) -#define islower(a) ((unsigned)((a)-'a') < 26) -#define isupper(a) ((unsigned)((a)-'A') < 26) -#define isprint(a) ((unsigned)((a)-0x20) < 0x5f) -#define isgraph(a) ((unsigned)((a)-0x21) < 0x5e) +#define isalpha(a) ((((unsigned)(a)|32)-'a') < 26) +#define isdigit(a) (((unsigned)(a)-'0') < 10) +#define islower(a) (((unsigned)(a)-'a') < 26) +#define isupper(a) (((unsigned)(a)-'A') < 26) +#define isprint(a) (((unsigned)(a)-0x20) < 0x5f) +#define isgraph(a) (((unsigned)(a)-0x21) < 0x5e) #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \ - || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) + || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) \ + || defined(_BSD_SOURCE) #define __NEED_locale_t #include @@ -53,4 +60,8 @@ int toascii(int); #endif +#ifdef __cplusplus +} +#endif + #endif