Fix directorout SWIGTYPE typemaps

This commit is contained in:
Olly Betts 2021-04-22 17:49:57 +12:00
commit 837dfa1e7e
3 changed files with 46 additions and 7 deletions

View file

@ -93,8 +93,8 @@
%typemap(directorout) SWIGTYPE ($&1_ltype tmp)
%{
if (SWIG_ConvertPtr($input, (void **) &tmp, $1_descriptor, 0) < 0 || tmp == NULL) {
SWIG_PHP_Error(E_ERROR, "Type error in argument $argnum of $symname. Expected $1_descriptor");
if (SWIG_ConvertPtr($input, (void **) &tmp, $&1_descriptor, 0) < 0 || tmp == NULL) {
SWIG_PHP_Error(E_ERROR, "Type error in argument $argnum of $symname. Expected $&1_descriptor");
}
$result = *tmp;
%}
@ -107,6 +107,15 @@
}
%}
%typemap(directorout) SWIGTYPE * (swig_owntype own),
SWIGTYPE [] (swig_owntype own)
%{
if (SWIG_ConvertPtrAndOwn($input, (void **)&$result, $1_descriptor, SWIG_POINTER_DISOWN, &own) < 0) {
SWIG_PHP_Error(E_ERROR, "Type error in argument $argnum of $symname. Expected $1_descriptor");
}
swig_acquire_ownership_obj((void*)$result, own);
%}
%typemap(in) SWIGTYPE &,
SWIGTYPE &&
%{
@ -115,6 +124,15 @@
}
%}
%typemap(directorout) SWIGTYPE & ($1_ltype tmp),
SWIGTYPE && ($1_ltype tmp)
%{
if (SWIG_ConvertPtr($input, (void **) &tmp, $1_descriptor, 0) < 0 || tmp == NULL) {
SWIG_PHP_Error(E_ERROR, "Type error in argument $argnum of $symname. Expected $1_descriptor");
}
$result = tmp;
%}
%typemap(in) SWIGTYPE *const& ($*ltype temp)
%{
if (SWIG_ConvertPtr(&$input, (void **) &temp, $*1_descriptor, 0) < 0) {