Fix dealing with class typedefs in do_resolve_type()
We must use the string for the resolved type, i.e. after replacing typedefs with their expansions, as otherwise typedefs could leak into the generated header. In principle it might be possible to actually use the original typedefs in the C++ part of the wrappers, but then we'd need to propagate the typedef definitions there too and we don't do it currently.
This commit is contained in:
parent
09f22c7453
commit
730384834d
1 changed files with 2 additions and 2 deletions
|
|
@ -715,12 +715,12 @@ private:
|
|||
} else {
|
||||
String* classname;
|
||||
if (Node* const class_node = Language::instance()->classLookup(type)) {
|
||||
typestr = SwigType_str(type, 0);
|
||||
typestr = SwigType_str(resolved_type, 0);
|
||||
classname = Getattr(class_node, "sym:name");
|
||||
|
||||
// We don't use namespaces, but the type may contain them, so get rid of them by replacing the base type name, which is fully qualified, with just the
|
||||
// class name, which is not.
|
||||
scoped_dohptr basetype(SwigType_base(type));
|
||||
scoped_dohptr basetype(SwigType_base(resolved_type));
|
||||
scoped_dohptr basetypestr(SwigType_str(basetype, 0));
|
||||
if (Cmp(basetypestr, classname) != 0) {
|
||||
Replaceall(typestr, basetypestr, classname);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue