Handle primitive types when expanding "resolved_type" in typemaps
Although the default typemaps only use "resolved_type" for non-simple types, the generic SWIGTYPE typemap can also be applied explicitly to other types as "apply_strings" and "char_binary" unit tests do. In this case just use the original type unchanged if we can, this is enough to make these tests pass.
This commit is contained in:
parent
4c654d9369
commit
e39265ba13
2 changed files with 10 additions and 5 deletions
|
|
@ -251,9 +251,16 @@ public:
|
|||
if (classname) {
|
||||
Replaceall(tm, classnamespecialvariable, classname); // getProxyName() works for pointers to classes too
|
||||
} else {
|
||||
String* const s = SwigType_str(classnametype, 0);
|
||||
Swig_error(Getfile(n), Getline(n), "Unhandled type \"%s\".\n", s);
|
||||
Delete(s);
|
||||
String* const typestr = SwigType_str(classnametype, 0);
|
||||
SwigType *btype = SwigType_base(classnametype);
|
||||
if (SwigType_isbuiltin(btype)) {
|
||||
// This should work just as well in C without any changes.
|
||||
Replaceall(tm, classnamespecialvariable, typestr);
|
||||
} else {
|
||||
Swig_error(Getfile(n), Getline(n), "Unhandled type \"%s\".\n", typestr);
|
||||
}
|
||||
Delete(btype);
|
||||
Delete(typestr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue