replace bad parameter names when neccessary
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7699 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
a2ee7e332d
commit
2ff3dd0d4e
10 changed files with 56 additions and 15 deletions
|
|
@ -10,7 +10,7 @@
|
|||
*/
|
||||
|
||||
/* activate all the name warnings */
|
||||
%warnfilter(+315,+321,-403);
|
||||
%warnfilter(+314,+321,-403);
|
||||
|
||||
%{
|
||||
#ifdef max
|
||||
|
|
@ -53,6 +53,15 @@
|
|||
B() {}
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
||||
%template(max_i) max<int>;
|
||||
|
||||
|
||||
%inline {
|
||||
/* silently rename the parameter names in csharp/java */
|
||||
|
||||
double foo(double in, double out) { return 1.0; }
|
||||
double bar(double native, bool boolean) { return 1.0; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@
|
|||
// Functions
|
||||
%inline %{
|
||||
int foo(int a = 1, int b = 0) {return a + b; }
|
||||
|
||||
|
||||
template<typename T> T templatedfunction(T a = 1, T b = 0) { return a + b; }
|
||||
%}
|
||||
|
|
@ -72,3 +73,12 @@
|
|||
}
|
||||
|
||||
%}
|
||||
|
||||
// Functions with keywords
|
||||
%warnfilter(-314);
|
||||
%inline %{
|
||||
/* silently rename the parameter names in python */
|
||||
|
||||
int foo_kw(int from = 1, int except = 2) {return from + except; }
|
||||
|
||||
%}
|
||||
|
|
|
|||
|
|
@ -42,3 +42,8 @@ if foo(a=1,b=2) != 3:
|
|||
if foo(b=2) != 3:
|
||||
raise RuntimeError
|
||||
|
||||
|
||||
#Funtions with keywords
|
||||
|
||||
if foo_kw(_from=2) != 4:
|
||||
raise RuntimeError
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue