added overriding test
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6336 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
0b3f8bf2ce
commit
d9de0f4d36
1 changed files with 9 additions and 6 deletions
|
|
@ -1,16 +1,19 @@
|
|||
%module overload_extend
|
||||
|
||||
#pragma SWIG nowarn=-302
|
||||
%extend Foo {
|
||||
int test() { return 0; }
|
||||
int test(int x) { x = 0; return 1; }
|
||||
int test(char *s) { s = 0; return 2; }
|
||||
int test(double x, double y = 0) { x = 0; y = 0; return 3; }
|
||||
};
|
||||
|
||||
%inline %{
|
||||
struct Foo {
|
||||
int test() { return 0; }
|
||||
int test() { return -1; }
|
||||
};
|
||||
%}
|
||||
|
||||
%extend Foo {
|
||||
int test(int x) { x = 0; return 1; }
|
||||
int test(char *s) { s = 0; return 2; }
|
||||
int test(double x, double y) { x = 0; y = 0; return 3; }
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue