swig/SWIG/Examples/test-suite/rename_default.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

27 lines
555 B
OpenEdge ABL

// Here's a nice little test for renaming, symbol table management, and default arguments
%module rename_default
// Rename a class member
%rename(bar2) Foo::bar;
%inline %{
// Define a class
class Foo {
public:
static int bar;
static int spam;
// Use a renamed member as a default argument. SWIG has to resolve
// bar to Foo::bar and not Foo::spam. SWIG-1.3.11 got this wrong.
void method1(int x = bar) {}
// Use unrenamed member as default
void method2(int x = spam) {}
};
int Foo::bar = 1;
int Foo::spam = 2;
%}