Fix %callback which was generating uncompileable code for C# and D

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12785 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2011-08-26 18:05:50 +00:00
commit 8b9afd0772
4 changed files with 7 additions and 1 deletions

View file

@ -5,6 +5,9 @@ See the RELEASENOTES file for a summary of changes in each release.
Version 2.0.5 (in progress)
===========================
2011-08-26: wsfulton
[C#, D] Fix %callback which was generating uncompileable code.
2011-08-25: wsfulton
Fix constructors in named typedef class declarations as reported by Gregory Bronner:

View file

@ -114,7 +114,7 @@
}
%}
%callback(1) func_cb;
%callback("%(uppercase)s_CALLBACK") func_cb;
%inline {
int func_cb(int c, int d) { return c; }

View file

@ -1403,6 +1403,7 @@ public:
String *return_type = NewString("");
String *constants_code = NewString("");
Swig_save("constantWrapper", n, "value", NIL);
Swig_save("constantWrapper", n, "tmap:ctype:out", "tmap:imtype:out", "tmap:cstype:out", "tmap:out:null", "tmap:imtype:outattributes", "tmap:cstype:outattributes", NIL);
bool is_enum_item = (Cmp(nodeType(n), "enumitem") == 0);

View file

@ -1404,6 +1404,7 @@ public:
// constants are already handeled in staticmemberfunctionHandler().
Swig_save("constantWrapper", n, "value", NIL);
Swig_save("constantWrapper", n, "tmap:ctype:out", "tmap:imtype:out", "tmap:dtype:out", "tmap:out:null", "tmap:imtype:outattributes", "tmap:dtype:outattributes", NIL);
// Add the stripped quotes back in.
String *old_value = Getattr(n, "value");
@ -1416,6 +1417,7 @@ public:
Delete(old_value);
}
SetFlag(n, "feature:immutable");
int result = globalvariableHandler(n);
Swig_restore(n);