1 #undef F 2 #undef N 3 #undef B 4 #undef TX 5 6 #ifdef SKIP_VA 7 const int test_va = 0; 8 #else 9 const int test_va = 1; 10 #endif 11 12 #define F(n, x, v, w) \ 13 if (p->x != arg.x) FAIL (n, 74); 14 #define N(n, x) 15 #define B(n, x, v, w) \ 16 if (p->x != arg.x) FAIL (n, 74); 17 #define TX(n, type, attrs, fields, ops) \ 18 void \ 19 check##n##va (int z, ...) \ 20 { \ 21 type S##n arg, *p; \ 22 va_list ap; \ 23 int i; \ 24 \ 25 if (test_va) \ 26 { \ 27 va_start (ap, z); \ 28 for (i = 0; i < 5; ++i) \ 29 { \ 30 p = NULL; \ 31 switch ((z << 4) | i) \ 32 { \ 33 case 0x10: \ 34 if (va_arg (ap, double) != 1.0) \ 35 FAIL (n, 70); \ 36 break; \ 37 case 0x12: \ 38 if (va_arg (ap, long long) != 2LL) \ 39 FAIL (n, 71); \ 40 break; \ 41 case 0x22: \ 42 if (va_arg (ap, long double) != 2.0L) \ 43 FAIL (n, 72); \ 44 break; \ 45 case 0x11: \ 46 case 0x20: \ 47 case 0x21: \ 48 case 0x24: \ 49 p = &s##n; \ 50 arg = va_arg (ap, type S##n); \ 51 break; \ 52 case 0x13: \ 53 case 0x14: \ 54 case 0x23: \ 55 p = &a##n[2]; \ 56 arg = va_arg (ap, type S##n); \ 57 break; \ 58 default: \ 59 FAIL (n, 73); \ 60 break; \ 61 } \ 62 if (p) \ 63 { \ 64 ops \ 65 } \ 66 } \ 67 va_end (ap); \ 68 } \ 69 } 70