swig/SWIG/Examples/test-suite/unions.i
Dave Beazley 516036631c The great merge
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4141 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2002-11-30 22:01:28 +00:00

35 lines
585 B
OpenEdge ABL

/*
This testcase checks that unions can be set and read.
*/
%module unions
%pragma make_default
%inline %{
typedef struct SmallStruct {
short jill;
} SmallStruct;
typedef struct BigStruct {
int jack;
SmallStruct smallstruct;
} BigStruct;
/* This union is just to check the parser */
typedef union {
BigStruct bs;
SmallStruct ss;
} UnionTest;
/* This union checks the parser and will be used in a runtime test */
typedef struct {
union
{
BigStruct big;
SmallStruct small;
} uni;
int number;
} EmbeddedUnionTest;
%}