Add (and use) the SWIG_POINTER_EXCEPTION and SWIG_POINTER_DISOWN flags

for the Ruby runtime support. Have not actually implemented support for
"disowning" Ruby pointers yet.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5122 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Logan Johnson 2003-09-19 18:47:27 +00:00
commit 87a1b982e3
2 changed files with 6 additions and 2 deletions

View file

@ -100,14 +100,14 @@ SWIG_ConvertPtr(VALUE obj, void **ptr, swig_type_info *ty, int flags)
}
}
if ((c = SWIG_MangleStr(obj)) == NULL) {
if (flags)
if (flags & SWIG_POINTER_EXCEPTION)
rb_raise(rb_eTypeError, "Expected %s", ty->str);
else
return -1;
}
tc = SWIG_TypeCheck(c, ty);
if (!tc) {
if (flags)
if (flags & SWIG_POINTER_EXCEPTION)
rb_raise(rb_eTypeError, "Expected %s", ty->str);
else
return -1;