Fix parsing of struct declaration and initialization
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11750 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
0286f6d43e
commit
7fd36f5bd6
6 changed files with 70 additions and 5 deletions
31
Examples/test-suite/struct_initialization.i
Normal file
31
Examples/test-suite/struct_initialization.i
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
// Test declaration and initialization of structs (C code)
|
||||
%module struct_initialization
|
||||
|
||||
%inline %{
|
||||
|
||||
// Named types
|
||||
struct StructA {
|
||||
int x;
|
||||
} instanceA1;
|
||||
|
||||
struct StructB {
|
||||
int x;
|
||||
} instanceB1, instanceB2, instanceB3;
|
||||
|
||||
struct StructC {
|
||||
int x;
|
||||
} instanceC1 = { 10 };
|
||||
|
||||
struct StructD {
|
||||
int x;
|
||||
} instanceD1 = { 10 }, instanceD2 = { 20 }, instanceD3 = { 30 };
|
||||
|
||||
struct StructE {
|
||||
int x;
|
||||
} instanceE1[3] = { { 1 }, { 2 }, { 3} };
|
||||
|
||||
struct StructF {
|
||||
int x;
|
||||
} instanceF1[3] = { { 1 }, { 2 } }, instanceF2[2] = { { -1 }, { -2 } }, instanceF3[2] = { { 11 }, { 22 } };
|
||||
|
||||
%}
|
||||
Loading…
Add table
Add a link
Reference in a new issue