]> git.ozlabs.org Git - ccan/blob - ccan/str/test/compile_fail-isdigit.c
base64: fix for unsigned chars (e.g. ARM).
[ccan] / ccan / str / test / compile_fail-isdigit.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
9 #error We need typeof to check isdigit.
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         return isdigit(c);
23 }