X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fstr%2Ftest%2Fcompile_fail-isblank.c;h=f4cb961d740d9dd0bc9b99825a3af51d3d50d848;hb=00e61068e33e7883a2657744514452a32660d461;hp=86a33503dab00fb0f3007f4c5c066030ad602c22;hpb=5c922794aa81cb2a62a034552f6478074b4dda14;p=ccan diff --git a/ccan/str/test/compile_fail-isblank.c b/ccan/str/test/compile_fail-isblank.c index 86a33503..f4cb961d 100644 --- a/ccan/str/test/compile_fail-isblank.c +++ b/ccan/str/test/compile_fail-isblank.c @@ -4,7 +4,7 @@ int main(int argc, char *argv[]) { #ifdef FAIL -#if !HAVE_BUILTIN_TYPES_COMPATIBLE_P || !HAVE_TYPEOF +#if !HAVE_BUILTIN_TYPES_COMPATIBLE_P || !HAVE_TYPEOF || !HAVE_ISBLANK #error We need typeof to check isblank. #endif char @@ -15,9 +15,12 @@ int main(int argc, char *argv[]) #ifdef FAIL /* Fake fail on unsigned char platforms. */ - c = 255; - BUILD_ASSERT(c < 0); + BUILD_ASSERT((char)255 < 0); #endif +#if HAVE_ISBLANK return isblank(c); +#else + return c; +#endif }