3 type: bool, char, unsigned char, unsigned short, unsigned long
10 #pragma disable_warning 180 //no warning about using complement on bit/unsigned char
13 #ifdef __bool_true_false_are_defined
17 char foo(bool a, bool b, char c)
22 char complement(bool a, bool b)
27 {type} _0 = 0, _1 = 1, _ff = 0xFF, _ffff = -1;
29 #endif //__bool_true_false_are_defined
34 #ifdef __bool_true_false_are_defined
36 ASSERT (foo(x,3,4) == 6);
38 ASSERT (complement (~_0, 1));
39 ASSERT (complement (~_1, 1));
42 ASSERT (complement (~_ff, 0));
44 ASSERT (complement (~_ff, 1));
48 ASSERT (complement (~_ffff, 1));
49 #elif defined TYPE_char
50 ASSERT (complement (~_ffff, 0));
52 if (sizeof({type}) < sizeof(int))
53 ASSERT (complement (~_ffff, 1));
55 ASSERT (complement (~_ffff, 0));
58 #endif //__bool_true_false_are_defined