Made a change to the type-checking code in SWIG_ConvertPtr() for the Ruby
module, so that the new multiple-inheritance support code will work. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4708 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
8fb4c9fceb
commit
542091e929
1 changed files with 19 additions and 23 deletions
|
|
@ -93,15 +93,12 @@ SWIG_ConvertPtr(VALUE obj, void **ptr, swig_type_info *ty, int flags)
|
||||||
/* Do type-checking if type info was provided */
|
/* Do type-checking if type info was provided */
|
||||||
if (ty) {
|
if (ty) {
|
||||||
if (ty->clientdata) {
|
if (ty->clientdata) {
|
||||||
if (!rb_obj_is_kind_of(obj, ((swig_class *) (ty->clientdata))->klass)) {
|
if (rb_obj_is_kind_of(obj, ((swig_class *) (ty->clientdata))->klass)) {
|
||||||
if (flags)
|
|
||||||
rb_raise(rb_eTypeError, "wrong argument type (expected %s)", ty->str);
|
|
||||||
else
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
if (*ptr == 0)
|
if (*ptr == 0)
|
||||||
rb_raise(rb_eRuntimeError, "This %s already released", ty->str);
|
rb_raise(rb_eRuntimeError, "This %s already released", ty->str);
|
||||||
} else {
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
if ((c = SWIG_MangleStr(obj)) == NULL) {
|
if ((c = SWIG_MangleStr(obj)) == NULL) {
|
||||||
if (flags)
|
if (flags)
|
||||||
rb_raise(rb_eTypeError, "Expected %s", ty->str);
|
rb_raise(rb_eTypeError, "Expected %s", ty->str);
|
||||||
|
|
@ -117,7 +114,6 @@ SWIG_ConvertPtr(VALUE obj, void **ptr, swig_type_info *ty, int flags)
|
||||||
}
|
}
|
||||||
*ptr = SWIG_TypeCast(tc, *ptr);
|
*ptr = SWIG_TypeCast(tc, *ptr);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue