(SWIG_Guile_NewPointerObj): Return '() to represent null pointers.
This is for compatibility with the -gh version. Also, GOOPS objects representing null pointers would behave very badly, like segfaulting when one DESCRIBEs them. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5383 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
35b19a4e71
commit
128784c26a
1 changed files with 22 additions and 19 deletions
|
|
@ -102,26 +102,29 @@ static SCM swig_symbol = SCM_EOL;
|
||||||
SWIGRUNTIME(SCM)
|
SWIGRUNTIME(SCM)
|
||||||
SWIG_Guile_NewPointerObj(void *ptr, swig_type_info *type, int owner)
|
SWIG_Guile_NewPointerObj(void *ptr, swig_type_info *type, int owner)
|
||||||
{
|
{
|
||||||
SCM smob;
|
if (ptr == NULL)
|
||||||
swig_guile_clientdata *cdata = (swig_guile_clientdata *) type->clientdata;
|
return SCM_EOL;
|
||||||
if (owner)
|
else {
|
||||||
SCM_NEWSMOB2(smob, swig_collectable_tag, ptr, (void *) type);
|
SCM smob;
|
||||||
else
|
swig_guile_clientdata *cdata = (swig_guile_clientdata *) type->clientdata;
|
||||||
SCM_NEWSMOB2(smob, swig_tag, ptr, (void *) type);
|
if (owner)
|
||||||
|
SCM_NEWSMOB2(smob, swig_collectable_tag, ptr, (void *) type);
|
||||||
|
else
|
||||||
|
SCM_NEWSMOB2(smob, swig_tag, ptr, (void *) type);
|
||||||
|
|
||||||
if (!cdata || SCM_NULLP(cdata->goops_class) || swig_make_func == SCM_EOL ) {
|
if (!cdata || SCM_NULLP(cdata->goops_class) || swig_make_func == SCM_EOL ) {
|
||||||
return smob;
|
return smob;
|
||||||
} else {
|
} else {
|
||||||
/* the scm_make() C function only handles the creation of gf, methods and classes (no instances)
|
/* the scm_make() C function only handles the creation of gf,
|
||||||
the (make ...) function is later redefined in goops.scm. So we need to lookup and
|
methods and classes (no instances) the (make ...) function is
|
||||||
call that function */
|
later redefined in goops.scm. So we need to call that
|
||||||
return scm_apply(
|
Scheme function. */
|
||||||
swig_make_func,
|
return scm_apply(swig_make_func,
|
||||||
scm_list_3(
|
scm_list_3(cdata->goops_class,
|
||||||
cdata->goops_class,
|
swig_keyword,
|
||||||
swig_keyword,
|
smob),
|
||||||
smob),
|
SCM_EOL);
|
||||||
SCM_EOL);
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue