Patch #3260265 fixing overloading of non-primitive types and integers in Perl 5.12 and later
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12691 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
527c3e0552
commit
ea00ff974f
4 changed files with 26 additions and 3 deletions
|
|
@ -274,8 +274,14 @@ SWIG_Perl_ConvertPtrAndOwn(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_
|
|||
return SWIG_OK;
|
||||
} else if (SvTYPE(sv) == SVt_RV) { /* Check for NULL pointer */
|
||||
if (!SvROK(sv)) {
|
||||
*(ptr) = (void *) 0;
|
||||
return SWIG_OK;
|
||||
/* In Perl 5.12 and later, SVt_RV == SVt_IV, so sv could be a valid integer value. */
|
||||
if (SvIOK(sv)) {
|
||||
return SWIG_ERROR;
|
||||
} else {
|
||||
/* NULL pointer (reference to undef). */
|
||||
*(ptr) = (void *) 0;
|
||||
return SWIG_OK;
|
||||
}
|
||||
} else {
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue