allow the result code to be passed to the error routine
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8323 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
502d6473e1
commit
1ee069a150
7 changed files with 189 additions and 147 deletions
|
|
@ -4,16 +4,18 @@
|
|||
|
||||
/* in */
|
||||
|
||||
%typemap(in,noblock=1) void * {
|
||||
if (!SWIG_IsOK((SWIG_ConvertPtr($input,%as_voidptrptr(&$1), 0, $disown)))) {
|
||||
%argument_fail(SWIG_TypeError, "$type", $symname, $argnum);
|
||||
%typemap(in,noblock=1) void * (int res) {
|
||||
res = SWIG_ConvertPtr($input,%as_voidptrptr(&$1), 0, $disown);
|
||||
if (!SWIG_IsOK(res)) {
|
||||
%argument_fail(res, "$type", $symname, $argnum);
|
||||
}
|
||||
}
|
||||
%typemap(freearg) void * "";
|
||||
|
||||
%typemap(in,noblock=1) void * const& ($*ltype temp) {
|
||||
if (!SWIG_IsOK((SWIG_ConvertPtr($input, %as_voidptrptr(&temp), 0, $disown)))) {
|
||||
%argument_fail(SWIG_TypeError, "Stype", $symname, $argnum);
|
||||
%typemap(in,noblock=1) void * const& ($*ltype temp, int res) {
|
||||
res = SWIG_ConvertPtr($input, %as_voidptrptr(&temp), 0, $disown);
|
||||
if (!SWIG_IsOK(res)) {
|
||||
%argument_fail(res, "Stype", $symname, $argnum);
|
||||
}
|
||||
$1 = &temp;
|
||||
}
|
||||
|
|
@ -32,8 +34,9 @@
|
|||
|
||||
%typemap(varin,noblock=1) void * {
|
||||
void *temp = 0;
|
||||
if (!SWIG_IsOK((SWIG_ConvertPtr($input, &temp, 0, SWIG_POINTER_DISOWN)))) {
|
||||
%variable_fail(SWIG_TypeError, "$type", "$name");
|
||||
int res = SWIG_ConvertPtr($input, &temp, 0, SWIG_POINTER_DISOWN);
|
||||
if (!SWIG_IsOK(res)) {
|
||||
%variable_fail(res, "$type", "$name");
|
||||
}
|
||||
$1 = ($1_ltype) temp;
|
||||
}
|
||||
|
|
@ -58,16 +61,18 @@
|
|||
|
||||
/* directorout */
|
||||
|
||||
%typemap(directorout,noblock=1) void * (void *argp) {
|
||||
if (!SWIG_IsOK((SWIG_ConvertPtr($input, &argp, 0, 0)))) {
|
||||
%dirout_fail(SWIG_TypeError,"$type");
|
||||
%typemap(directorout,noblock=1) void * (void *argp, int res) {
|
||||
res = SWIG_ConvertPtr($input, &argp, 0, 0);
|
||||
if (!SWIG_IsOK(res)) {
|
||||
%dirout_fail(res,"$type");
|
||||
}
|
||||
$result = %reinterpret_cast(argp, $ltype);
|
||||
}
|
||||
|
||||
%typemap(directorout,noblock=1,warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) void * const& (void *argp) {
|
||||
if (!SWIG_IsOK((SWIG_ConvertPtr($input, &argp, 0, $disown)))) {
|
||||
%dirout_fail(SWIG_TypeError,"$type");
|
||||
%typemap(directorout,noblock=1,warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) void * const& (void *argp, int res) {
|
||||
res = SWIG_ConvertPtr($input, &argp, 0, $disown);
|
||||
if (!SWIG_IsOK(res)) {
|
||||
%dirout_fail(res,"$type");
|
||||
}
|
||||
static $*ltype temp = %reinterpret_cast(argp, $*ltype);
|
||||
$result = &temp;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue