Commit 082d651f authored by Rusty Russell's avatar Rusty Russell

configure.h: HAVE_ISBLANK

This isn't on RHEL4, for example: isascii() and isblank() are not in
C89.
parent b0a59bdc
......@@ -24,11 +24,13 @@ int str_isascii(int i)
return isascii(i);
}
#if HAVE_ISBLANK
int str_isblank(int i)
{
assert(i >= -1 && i < 256);
return isblank(i);
}
#endif
int str_iscntrl(int i)
{
......
......@@ -91,10 +91,12 @@ static inline bool cisascii(char c)
{
return isascii((unsigned char)c);
}
#if HAVE_ISBLANK
static inline bool cisblank(char c)
{
return isblank((unsigned char)c);
}
#endif
static inline bool ciscntrl(char c)
{
return iscntrl((unsigned char)c);
......@@ -166,7 +168,9 @@ static inline bool cisxdigit(char c)
#define isalnum(i) str_isalnum(str_check_arg_(i))
#define isalpha(i) str_isalpha(str_check_arg_(i))
#define isascii(i) str_isascii(str_check_arg_(i))
#if HAVE_ISBLANK
#define isblank(i) str_isblank(str_check_arg_(i))
#endif
#define iscntrl(i) str_iscntrl(str_check_arg_(i))
#define isdigit(i) str_isdigit(str_check_arg_(i))
#define isgraph(i) str_isgraph(str_check_arg_(i))
......
......@@ -8,7 +8,9 @@
int str_isalnum(int i);
int str_isalpha(int i);
int str_isascii(int i);
#if HAVE_ISBLANK
int str_isblank(int i);
#endif
int str_iscntrl(int i);
int str_isdigit(int i);
int str_isgraph(int i);
......
......@@ -31,6 +31,7 @@
#define HAVE_FOR_LOOP_DECLARATION 0
#define HAVE_FLEXIBLE_ARRAY_MEMBER 1
#define HAVE_GETPAGESIZE 1
#define HAVE_ISBLANK 1
#define HAVE_LITTLE_ENDIAN 1
#define HAVE_MEMMEM 1
#define HAVE_MMAP 1
......
......@@ -102,6 +102,9 @@ static struct test tests[] = {
{ "HAVE_GETPAGESIZE", DEFINES_FUNC, NULL,
"#include <unistd.h>\n"
"static int func(void) { return getpagesize(); }" },
{ "HAVE_ISBLANK", DEFINES_FUNC, NULL,
"#include <ctype.h>\n"
"static int func(void) { return isblank(' '); }" },
{ "HAVE_LITTLE_ENDIAN", INSIDE_MAIN|EXECUTE, NULL,
"union { int i; char c[sizeof(int)]; } u;\n"
"u.i = 0x01020304;\n"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment