compile_fail-isalpha.c 369 B

12345678910111213141516171819202122
  1. #define CCAN_STR_DEBUG 1
  2. #include <ccan/str/str.h>
  3. int main(int argc, char *argv[])
  4. {
  5. #ifdef FAIL
  6. #if !HAVE_BUILTIN_TYPES_COMPATIBLE_P || !HAVE_TYPEOF
  7. #error We need typeof to check isalpha.
  8. #endif
  9. char
  10. #else
  11. unsigned char
  12. #endif
  13. c = argv[0][0];
  14. #ifdef FAIL
  15. /* Fake fail on unsigned char platforms. */
  16. BUILD_ASSERT((char)255 < 0);
  17. #endif
  18. return isalpha(c);
  19. }