diff --git a/SWIG/Source/Modules/directors.cxx b/SWIG/Source/Modules/directors.cxx index 64286edc7..df55a95a3 100644 --- a/SWIG/Source/Modules/directors.cxx +++ b/SWIG/Source/Modules/directors.cxx @@ -79,7 +79,7 @@ String *Swig_director_declaration(Node *n) { String *directorname = NewStringf("SwigDirector_%s", classname); String *base = Getattr(n, "classtype"); String *declaration = Swig_class_declaration(n, directorname); - Printf(declaration, " : public %s, virtual public Swig::Director {\n", base); + Printf(declaration, " : virtual public Swig::Director, public %s {\n", base); Delete(classname); Delete(directorname); return declaration; diff --git a/SWIG/Source/Modules/ocaml.cxx b/SWIG/Source/Modules/ocaml.cxx index 5d5e7ec83..07e16391a 100755 --- a/SWIG/Source/Modules/ocaml.cxx +++ b/SWIG/Source/Modules/ocaml.cxx @@ -1833,7 +1833,7 @@ public: String *basetype = Getattr(parent, "classtype"); String *target = Swig_method_decl(decl, classname, parms, 0, 0); call = Swig_csuperclass_call(0, basetype, superparms); - Printf( w->def, "%s::%s: %s, Swig::Director(self) { }", classname, target, call ); + Printf( w->def, "%s::%s: Swig::Director(self), %s { }", classname, target, call ); Delete(target); Wrapper_print(w, f_directors); Delete(call); diff --git a/SWIG/Source/Modules/python.cxx b/SWIG/Source/Modules/python.cxx index aa83a9d6e..1908a84bd 100644 --- a/SWIG/Source/Modules/python.cxx +++ b/SWIG/Source/Modules/python.cxx @@ -1812,7 +1812,7 @@ public: String *basetype = Getattr(parent, "classtype"); String *target = Swig_method_decl(decl, classname, parms, 0, 0); call = Swig_csuperclass_call(0, basetype, superparms); - Printf(w->def, "%s::%s: %s, Swig::Director(self) { \n", classname, target, call); + Printf(w->def, "%s::%s: Swig::Director(self), %s { \n", classname, target, call); Printf(w->def, " SWIG_DIRECTOR_RGTR((%s *)this, this); \n", basetype); Printf(w->def, "}\n"); Delete(target); diff --git a/SWIG/Source/Modules/ruby.cxx b/SWIG/Source/Modules/ruby.cxx index e7e6a7964..817506ac7 100644 --- a/SWIG/Source/Modules/ruby.cxx +++ b/SWIG/Source/Modules/ruby.cxx @@ -1227,12 +1227,13 @@ public: if (current == CONSTRUCTOR_INITIALIZE) { Node *pn = Swig_methodclass(n); String *symname = Getattr(pn,"sym:name"); - String *classname = NewStringf("const char *classname = \"%s::%s\"", module, symname); - Wrapper_add_local(f, "classname", classname); String *action = Getattr(n,"wrap:action"); + if (directorsEnabled()) { + String *classname = NewStringf("const char *classname SWIGUNUSED = \"%s::%s\"", module, symname); + Wrapper_add_local(f, "classname", classname); + } if (action) { Append(action,"DATA_PTR(self) = result;\n"); - if (GetFlag(n,"feature:trackobjects")) { Append(action,"SWIG_RubyAddTracking(result, self);\n"); } @@ -2146,7 +2147,7 @@ public: String *basetype = Getattr(parent, "classtype"); String *target = Swig_method_decl(decl, classname, parms, 0, 0); call = Swig_csuperclass_call(0, basetype, superparms); - Printf(w->def, "%s::%s: %s, Swig::Director(self) { }", classname, target, call); + Printf(w->def, "%s::%s: Swig::Director(self), %s { }", classname, target, call); Delete(target); Wrapper_print(w, f_directors); Delete(call);