import source from 1.3.40
[external/swig.git] / Examples / test-suite / nested.i
1 /* 
2 This testcase tests that nested structs/unions work. Named structs/unions declared within
3 a struct produced redefinition errors in SWIG 1.3.6 as reported by SF bug #447488.
4 Also tests reported error when a #define placed in a deeply embedded struct/union.
5 */
6
7 %module nested
8
9 %inline %{
10
11 struct TestStruct {
12   int a;
13 };
14
15 typedef struct OuterStruct {
16   union {
17
18     struct outer_nested_struct {
19       union inner_nested_union {
20 #define BAD_STYLE 1
21         int red;
22         struct TestStruct green;
23       } InnerNestedUnion;
24
25       struct inner_nested_struct {
26         int blue;
27       } InnerNestedStruct;
28     } OuterNestedStruct;
29
30   } EmbeddedUnion;
31 } OuterStruct;
32
33 %}