added overriding test
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6336 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
e4e9a5e61b
commit
e9c0244097
1 changed files with 9 additions and 6 deletions
|
|
@ -1,16 +1,19 @@
|
||||||
%module overload_extend
|
%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 %{
|
%inline %{
|
||||||
struct Foo {
|
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