Added some missing throws typemaps for SWIGTYPE and its variants.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6123 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
9a6eb5a6b8
commit
14e616436c
1 changed files with 7 additions and 19 deletions
|
|
@ -1,5 +1,4 @@
|
||||||
/* Typemaps for pointers. Note: the SWIG run-time type checker works
|
/* --- Input typemaps --- */
|
||||||
even if a pointer happens to be mapped to a Ruby class */
|
|
||||||
|
|
||||||
%typemap(in) SWIGTYPE *,
|
%typemap(in) SWIGTYPE *,
|
||||||
SWIGTYPE []
|
SWIGTYPE []
|
||||||
|
|
@ -113,14 +112,7 @@
|
||||||
|
|
||||||
%typemap(constant) SWIGTYPE (CLASS::*) "rb_define_const($module, \"$symname\", SWIG_NewPackedObj((void *) &$1, sizeof($type), $1_descriptor));";
|
%typemap(constant) SWIGTYPE (CLASS::*) "rb_define_const($module, \"$symname\", SWIG_NewPackedObj((void *) &$1, sizeof($type), $1_descriptor));";
|
||||||
|
|
||||||
/*****************************************************************************
|
/* --- directorin typemaps --- */
|
||||||
*
|
|
||||||
* Inverse argument typemaps are for marshaling C/C++ parameters to call Python
|
|
||||||
* methods from C++ proxy wrapper classes.
|
|
||||||
*
|
|
||||||
*****************************************************************************/
|
|
||||||
|
|
||||||
/* directorin typemaps */
|
|
||||||
|
|
||||||
/* --- directorout typemaps --- */
|
/* --- directorout typemaps --- */
|
||||||
%typemap(directorout) SWIGTYPE *,
|
%typemap(directorout) SWIGTYPE *,
|
||||||
|
|
@ -143,15 +135,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ------------------------------------------------------------
|
/* ------------------------------------------------------------
|
||||||
* Exception handling
|
* Exception handling.
|
||||||
|
* Note that in Ruby, we can only raise an exception class and
|
||||||
|
* not some arbitrary object as in Python.
|
||||||
* ------------------------------------------------------------ */
|
* ------------------------------------------------------------ */
|
||||||
|
|
||||||
%typemap(throws) SWIGTYPE {
|
%typemap(throws) SWIGTYPE, SWIGTYPE *, SWIGTYPE [ANY], SWIGTYPE &
|
||||||
$&1_ltype temp = new $1_ltype($1);
|
"rb_raise(rb_eRuntimeError, \"$1_type\");";
|
||||||
if ($&1_descriptor->clientdata) {
|
|
||||||
rb_exc_raise(rb_exc_new3(((swig_class *) ($&1_descriptor->clientdata))->klass, rb_obj_as_string(SWIG_NewPointerObj(temp, $&1_descriptor, 1))));
|
|
||||||
} else {
|
|
||||||
rb_exc_raise(rb_exc_new3(rb_eRuntimeError, rb_obj_as_string(SWIG_NewPointerObj(temp, $&1_descriptor, 1))));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue