partial fix for abstract director classes

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4534 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Mark Rose 2003-03-14 07:14:04 +00:00
commit d0f9431db8
5 changed files with 50 additions and 14 deletions

View file

@ -1270,9 +1270,18 @@ public:
String *tm;
String *wrap_args;
String *return_type;
String *value = Getattr(n, "value");
String *storage = Getattr(n,"storage");
bool pure_virtual = false;
int status = SWIG_OK;
int idx;
if (Cmp(storage,"virtual") == 0) {
if (Cmp(value,"0") == 0) {
pure_virtual = true;
}
}
classname = Getattr(parent, "sym:name");
type = Getattr(n, "type");
name = Getattr(n, "name");
@ -1446,7 +1455,11 @@ public:
/* direct call to superclass if _up is set */
Printf(w->code, "if (__get_up()) {\n");
Printf(w->code, "return %s;\n", Swig_method_call(super,l));
if (pure_virtual) {
Printf(w->code, "throw SWIG_DIRECTOR_PURE_VIRTUAL_EXCEPTION();\n");
} else {
Printf(w->code, "return %s;\n", Swig_method_call(super,l));
}
Printf(w->code, "}\n");
/* check that have a wrapped Python object */