add better director+exception support

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7038 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2005-03-07 20:47:55 +00:00
commit ca7159f7e7
9 changed files with 203 additions and 108 deletions

View file

@ -71,12 +71,12 @@
%typemap(directorargout,fragment=pyfrag) Type *DIRECTOROUT {
if ($input) *$result = SWIG_static_cast(SWIG_arg(as_meth($input)),$type);
if (!$input || PyErr_Occurred())
throw Swig::DirectorTypeMismatchException("Error converting Python object using as_meth");
Swig::DirectorTypeMismatchException::raise("Error converting Python object when using as_meth.");
}
%typemap(directorout,fragment=pyfrag) Type {
if ($input) $result = SWIG_static_cast(SWIG_arg(as_meth($input)),$type);
if (!$input || PyErr_Occurred())
throw Swig::DirectorTypeMismatchException("Error converting Python object using as_meth");
Swig::DirectorTypeMismatchException::raise("Error converting Python object when using as_meth.");
}
%typemap(directorout,fragment=pyfrag,warning="470:Using thread/reentrant unsafe wrapping, consider using a plain '"#Type"' return type instead.") const Type& {
if ($input) {
@ -84,7 +84,7 @@
$result = &temp;
}
if (!$input || PyErr_Occurred())
throw Swig::DirectorTypeMismatchException("Error converting Python object using as_meth");
Swig::DirectorTypeMismatchException::raise("Error converting Python object when using as_meth.");
}
%typemap(directorout,fragment=pyfrag) Type &DIRECTOROUT = Type
%enddef