fix for directors, now the test-suite runs again using -directors

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@8856 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2006-02-21 11:20:09 +00:00
commit d388046661
6 changed files with 31 additions and 10 deletions

View file

@ -9,7 +9,13 @@ include Abstract_signature
exceptionRaised = false exceptionRaised = false
begin begin
Abstract_foo.new foo = Abstract_foo.new
begin
foo.meth(1)
rescue RuntimeError
# here we are using directors
exceptionRaised = true
end
rescue NameError rescue NameError
exceptionRaised = true exceptionRaised = true
rescue TypeError rescue TypeError
@ -27,7 +33,13 @@ end
exceptionRaised = false exceptionRaised = false
begin begin
Abstract_bar.new bar = Abstract_bar.new
begin
bar.meth(1)
rescue RuntimeError
# here we are using directors
exceptionRaised = true
end
rescue NameError rescue NameError
exceptionRaised = true exceptionRaised = true
rescue TypeError rescue TypeError

View file

@ -25,17 +25,17 @@ public:
// Testing ignore // Testing ignore
%ignore std::vector<Flow>::vector(size_type); %ignore std::tvector<Flow>::tvector(size_type);
%inline %{ %inline %{
namespace std { namespace std {
template<class T> class vector { template<class T> class tvector {
public: public:
typedef size_t size_type; typedef size_t size_type;
vector() {} tvector() {}
vector(size_type n) { T t = T(); } tvector(size_type n) { T t = T(); }
}; };
} }
@ -46,4 +46,4 @@ public:
}; };
%} %}
%template(VectFlow) std::vector<Flow>; %template(VectFlow) std::tvector<Flow>;

View file

@ -50,3 +50,8 @@ type SWIGMACRO_##name(lparams) {
*/ */
%{
#ifdef max
#undef max
#endif
%}

View file

@ -1997,7 +1997,7 @@ module_directive: MODULE options idstring {
if ($2) { if ($2) {
Setattr($$,"options",$2); Setattr($$,"options",$2);
if (Getattr($2,"directors")) { if (Getattr($2,"directors")) {
/* Wrapper_director_mode_set(1);*/ Wrapper_director_mode_set(1);
} }
if (Getattr($2,"templatereduce")) { if (Getattr($2,"templatereduce")) {
template_reduce = 1; template_reduce = 1;

View file

@ -1657,7 +1657,10 @@ String *vtable_method_id(Node *n)
String *name = Getattr(n, "name"); String *name = Getattr(n, "name");
String *decl = Getattr(n, "decl"); String *decl = Getattr(n, "decl");
String *local_decl = SwigType_typedef_resolve_all(decl); String *local_decl = SwigType_typedef_resolve_all(decl);
Node *method_id = NewStringf("%s|%s", name, local_decl); String *tmp = SwigType_pop_function(local_decl);
Delete(local_decl);
local_decl = tmp;
Node *method_id = NewStringf("%s|%s", name, local_decl);
Delete(local_decl); Delete(local_decl);
return method_id; return method_id;
} }

View file

@ -1175,7 +1175,8 @@ public:
emit_action(n,f); emit_action(n,f);
if (director_method) { if (director_method) {
Printf(f->code, "} catch (Swig::DirectorException&) {\n"); Printf(f->code, "} catch (Swig::DirectorException& e) {\n");
Printf(f->code, " rb_exc_raise(e.getError());\n");
Printf(f->code, " SWIG_fail;\n"); Printf(f->code, " SWIG_fail;\n");
Printf(f->code, "}\n"); Printf(f->code, "}\n");
} }