better error messages, more comments, clean up for the next major modifications

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6284 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2004-10-02 01:43:17 +00:00
commit a4a7a2ff1f
25 changed files with 633 additions and 286 deletions

View file

@ -9,10 +9,10 @@
%define PYVAL_IN_TYPEMAP(as_meth,pyfrag,...)
%typemap(in,fragment=pyfrag) __VA_ARGS__
"$1 = ($ltype)as_meth($input);
if (PyErr_Occurred()) SWIG_fail;";
if (SWIG_arg_fail($argnum)) SWIG_fail;";
%typemap(in,fragment=pyfrag) const __VA_ARGS__ & ($basetype temp)
"temp = ($basetype) as_meth($input);
if (PyErr_Occurred()) SWIG_fail;
if (SWIG_arg_fail($argnum)) SWIG_fail;
$1 = &temp;";
%enddef
@ -31,7 +31,7 @@
%typemap(varin,fragment=pyfrag) __VA_ARGS__ {
$1_type temp = ($1_type) as_meth($input);
if (PyErr_Occurred()) {
PyErr_SetString(PyExc_TypeError, "C/C++ variable '$name ($1_ltype)'");
SWIG_append_errmsg("C/C++ variable '$name ($1_ltype)'");
return 1;
}
$1 = temp;