Fix overloading for non-pointers and NULL - Php

This commit is contained in:
William S Fulton 2018-12-30 12:00:49 +00:00
commit b7db45661a
3 changed files with 57 additions and 4 deletions

View file

@ -5,6 +5,7 @@
* ----------------------------------------------------------------------------- */
%runtime "swigrun.swg" // Common C API type-checking code
%runtime "swigerrors.swg" // SWIG errors
%runtime "phprun.swg" // PHP runtime functions
%include <phpinit.swg> // PHP initialization routine.
@ -470,20 +471,26 @@
%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE
{
void *tmp;
_v = (SWIG_ConvertPtr(&$input, (void **)&tmp, $&1_descriptor, 0) >= 0);
_v = (SWIG_ConvertPtr(&$input, (void **)&tmp, $&1_descriptor, SWIG_POINTER_NO_NULL) >= 0);
}
%typecheck(SWIG_TYPECHECK_POINTER)
SWIGTYPE *,
SWIGTYPE [],
SWIGTYPE &,
SWIGTYPE &&,
SWIGTYPE *const&
{
void *tmp;
_v = (SWIG_ConvertPtr(&$input, (void**)&tmp, $1_descriptor, 0) >= 0);
}
%typecheck(SWIG_TYPECHECK_POINTER)
SWIGTYPE &,
SWIGTYPE &&
{
void *tmp;
_v = (SWIG_ConvertPtr(&$input, (void**)&tmp, $1_descriptor, SWIG_POINTER_NO_NULL) >= 0);
}
%typecheck(SWIG_TYPECHECK_POINTER) SWIGTYPE *const&
{
void *tmp;

View file

@ -217,7 +217,7 @@ SWIG_ConvertPtr(zval *z, void **ptr, swig_type_info *ty, int flags) {
return (*ptr == NULL ? -1 : 0);
case IS_NULL:
*ptr = 0;
return 0;
return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK;
}
return -1;