Partial support for %constant and structs
Test case is slightly modified from the test case in issue #250 Use of constant objects does not seem to work in Python - the type is SwigPyObject instead of constant_directive.Type1.
This commit is contained in:
parent
c915583bf9
commit
2e01533b23
7 changed files with 32 additions and 48 deletions
|
|
@ -1614,7 +1614,14 @@ int Swig_VargetToFunction(Node *n, int flags) {
|
|||
Delete(mangled);
|
||||
Delete(sname);
|
||||
} else {
|
||||
String *nname = SwigType_namestr(name);
|
||||
String *nname = 0;
|
||||
if (Equal(nodeType(n), "constant")) {
|
||||
String *rawval = Getattr(n, "rawval");
|
||||
String *value = rawval ? rawval : Getattr(n, "value");
|
||||
nname = NewStringf("(%s)", value);
|
||||
} else {
|
||||
nname = SwigType_namestr(name);
|
||||
}
|
||||
call = Swig_wrapped_var_assign(type, nname, varcref);
|
||||
cres = Swig_cresult(ty, Swig_cresult_name(), call);
|
||||
Setattr(n, "wrap:action", cres);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue