Merge Makefile rewrite into master
[ccan] / ccan / str / test / compile_fail-isblank.c
1 #define CCAN_STR_DEBUG 1
2 #include <ccan/str/str.h>
3
4 int main(int argc, char *argv[])
5 {
6         (void)argc;
7 #ifdef FAIL
8 #if !HAVE_BUILTIN_TYPES_COMPATIBLE_P || !HAVE_TYPEOF || !HAVE_ISBLANK
9 #error We need typeof to check isblank.
10 #endif
11         char
12 #else
13         unsigned char
14 #endif
15                 c = argv[0][0];
16
17 #ifdef FAIL
18         /* Fake fail on unsigned char platforms. */
19         BUILD_ASSERT((char)255 < 0);
20 #endif
21
22 #if HAVE_ISBLANK
23         return isblank(c);
24 #else
25         return c;
26 #endif
27 }