1 #include <ccan/tcon/tcon.h>
2 #include <ccan/build_assert/build_assert.h>
14 struct charp_and_int_container {
16 TCON(int tc1; char *tc2);
19 int main(int argc, char *argv[])
21 struct int_container icon;
22 struct charp_and_int_container cicon;
23 TCON_WRAP(struct container, int tc) iconw;
24 TCON_WRAP(struct container, int tc1; char *tc2) ciconw;
27 tcon_check(&icon, tc, 7)->raw.p = NULL;
28 tcon_check(&cicon, tc1, 7)->raw.p = argv[0];
29 tcon_check(&cicon, tc2, argv[0])->raw.p = argv[0];
31 tcon_unwrap(tcon_check(&iconw, tc, 7))->p = NULL;
32 tcon_unwrap(tcon_check(&ciconw, tc1, 7))->p = argv[0];
33 tcon_unwrap(tcon_check(&ciconw, tc2, argv[0]))->p = argv[0];
35 BUILD_ASSERT(sizeof(iconw) == sizeof(struct container));
36 BUILD_ASSERT(sizeof(ciconw) == sizeof(struct container));