Virtual methods in C# proxy classes now use the appropriate keyword, virtual or override.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4526 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
6abbf36a8f
commit
8bb8521a46
1 changed files with 41 additions and 39 deletions
|
|
@ -1087,9 +1087,9 @@ class CSHARP : public Language {
|
||||||
derived?javaTypemapLookup("cildisposeoverride", shadow_classname, WARN_NONE):
|
derived?javaTypemapLookup("cildisposeoverride", shadow_classname, WARN_NONE):
|
||||||
javaTypemapLookup("cildispose", shadow_classname, WARN_NONE), // finalize method
|
javaTypemapLookup("cildispose", shadow_classname, WARN_NONE), // finalize method
|
||||||
"\n",
|
"\n",
|
||||||
*Char(destructor_call) ?
|
*Char(destructor_call) ? " protected " : " private ",
|
||||||
" protected void delete() {\n" :
|
derived ? "override" : "virtual",
|
||||||
" private void delete() {\n",
|
" void delete() {\n",
|
||||||
" if(swigCPtr != IntPtr.Zero && swigCMemOwn) {\n",
|
" if(swigCPtr != IntPtr.Zero && swigCMemOwn) {\n",
|
||||||
destructor_call,
|
destructor_call,
|
||||||
"",
|
"",
|
||||||
|
|
@ -1463,9 +1463,11 @@ class CSHARP : public Language {
|
||||||
Printf(shadow_code, " %s ", Getattr(n,"feature:java:methodmodifiers"));
|
Printf(shadow_code, " %s ", Getattr(n,"feature:java:methodmodifiers"));
|
||||||
if (static_flag)
|
if (static_flag)
|
||||||
Printf(shadow_code, "static ");
|
Printf(shadow_code, "static ");
|
||||||
else
|
if (Getattr(n,"virtual:derived"))
|
||||||
|
Printf(shadow_code, "override ");
|
||||||
|
else if (checkAttribute(n, "storage", "virtual"))
|
||||||
Printf(shadow_code, "virtual ");
|
Printf(shadow_code, "virtual ");
|
||||||
//make all methods virtual unless they are static - you might want to change this..
|
|
||||||
Printf(shadow_code, "%s %s(", shadowrettype, java_shadow_function_name);
|
Printf(shadow_code, "%s %s(", shadowrettype, java_shadow_function_name);
|
||||||
|
|
||||||
Printv(nativecall, jniclass_name, ".", java_function_name, "(", NIL);
|
Printv(nativecall, jniclass_name, ".", java_function_name, "(", NIL);
|
||||||
|
|
@ -1623,7 +1625,7 @@ class CSHARP : public Language {
|
||||||
p = Getattr(p,"tmap:in:next");
|
p = Getattr(p,"tmap:in:next");
|
||||||
}
|
}
|
||||||
|
|
||||||
Printf(nativecall, "), true)\n");
|
Printf(nativecall, "), true)");
|
||||||
|
|
||||||
Printf(shadow_code, ")");
|
Printf(shadow_code, ")");
|
||||||
Printf(shadow_code,"%s", nativecall);
|
Printf(shadow_code,"%s", nativecall);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue