]> git.ozlabs.org Git - ccan/blob - ccan/typesafe_cb/test/compile_ok-typesafe_cb_cast.c
tdb2: rename the tools to tdb2torture, tdb2tool and mktdb2
[ccan] / ccan / typesafe_cb / test / compile_ok-typesafe_cb_cast.c
1 #include <ccan/typesafe_cb/typesafe_cb.h>
2 #include <stdlib.h>
3
4 struct foo {
5         int x;
6 };
7
8 struct bar {
9         int x;
10 };
11
12 struct baz {
13         int x;
14 };
15
16 struct any {
17         int x;
18 };
19
20 static void take_any(struct any *any)
21 {
22 }
23
24 int main(int argc, char *argv[])
25 {
26         /* Otherwise we get unused warnings for these. */
27         struct foo *foo = NULL;
28         struct bar *bar = NULL;
29         struct baz *baz = NULL;
30
31         take_any(typesafe_cb_cast3(struct any *,
32                                    struct foo *, struct bar *, struct baz *,
33                                    foo));
34         take_any(typesafe_cb_cast3(struct any *, 
35                                    struct foo *, struct bar *, struct baz *,
36                                    bar));
37         take_any(typesafe_cb_cast3(struct any *, 
38                                    struct foo *, struct bar *, struct baz *,
39                                    baz));
40         return 0;
41 }