]> git.ozlabs.org Git - ccan/blob - ccan/typesafe_cb/test/compile_fail-cast_if_any.c
typesafe_cb: expose _exact and _def variants.
[ccan] / ccan / typesafe_cb / test / compile_fail-cast_if_any.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 struct other {
21         int x;
22 };
23
24 static void take_any(struct any *any)
25 {
26 }
27
28 int main(int argc, char *argv[])
29 {
30 #ifdef FAIL
31         struct other
32 #else
33         struct foo
34 #endif
35                 *arg = NULL;
36         take_any(cast_if_any(struct any *, arg, arg,
37                              struct foo *, struct bar *, struct baz *));
38         return 0;
39 }