Correctly skip ignored base classes in C++ wrappers
Don't refuse to generate C++ wrapper class if there is just one real base class and the other one(s) are ignored.
This commit is contained in:
parent
0483e4017c
commit
036e3eb08c
1 changed files with 6 additions and 5 deletions
|
|
@ -189,12 +189,11 @@ public:
|
||||||
|
|
||||||
scoped_dohptr base_classes(NewStringEmpty());
|
scoped_dohptr base_classes(NewStringEmpty());
|
||||||
if (List *baselist = Getattr(n, "bases")) {
|
if (List *baselist = Getattr(n, "bases")) {
|
||||||
Iterator i = First(baselist);
|
for (Iterator i = First(baselist); i.item; i = Next(i)) {
|
||||||
if (i.item) {
|
if (Checkattr(i.item, "feature:ignore", "1"))
|
||||||
first_base_ = Copy(i.item);
|
continue;
|
||||||
|
|
||||||
i = Next(i);
|
if (first_base_) {
|
||||||
if (i.item) {
|
|
||||||
Swig_warning(WARN_C_UNSUPPORTTED, Getfile(n), Getline(n),
|
Swig_warning(WARN_C_UNSUPPORTTED, Getfile(n), Getline(n),
|
||||||
"Multiple inheritance not supported yet, skipping C++ wrapper generation for %s\n",
|
"Multiple inheritance not supported yet, skipping C++ wrapper generation for %s\n",
|
||||||
Getattr(n, "sym:name")
|
Getattr(n, "sym:name")
|
||||||
|
|
@ -203,6 +202,8 @@ public:
|
||||||
// Return before initializing class_node_, so that the dtor won't output anything neither.
|
// Return before initializing class_node_, so that the dtor won't output anything neither.
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
first_base_ = Copy(i.item);
|
||||||
}
|
}
|
||||||
|
|
||||||
Printv(base_classes, " : public ", Getattr(first_base_, "sym:name"), NIL);
|
Printv(base_classes, " : public ", Getattr(first_base_, "sym:name"), NIL);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue