#ifndef _CTYPE_H
#define _CTYPE_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <features.h>
+
int isalnum(int);
int isalpha(int);
int isblank(int);
int tolower(int);
int toupper(int);
+#ifndef __cplusplus
+static __inline int __isspace(int _c)
+{
+ return _c == ' ' || (unsigned)_c-'\t' < 5;
+}
+
#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 isspace(a) __isspace(a)
+#endif
#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 <bits/alltypes.h>
#endif
+#ifdef __cplusplus
+}
+#endif
+
#endif