[PHP] The usage of $input in PHP directorout typemaps has been

changed to be consistent with other languages.  The typemaps
provided by SWIG have been updated accordingly, but if you
have written your own directorout typemaps, you'll need to
update $input to &$input (or make equivalent changes).

*** POTENTIAL INCOMPATIBILITY  ***
This commit is contained in:
Olly Betts 2013-12-12 15:39:10 +13:00
commit cecd89f66f
6 changed files with 17 additions and 27 deletions

View file

@ -93,7 +93,7 @@
%typemap(directorout) SWIGTYPE ($&1_ltype tmp)
{
if(SWIG_ConvertPtr(*$input, (void **) &tmp, $&1_descriptor, 0) < 0 || tmp == NULL) {
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;

View file

@ -33,8 +33,8 @@ namespace std {
%}
%typemap(directorout) string %{
convert_to_string_ex($input);
$result.assign(Z_STRVAL_PP($input), Z_STRLEN_PP($input));
convert_to_string_ex(&$input);
$result.assign(Z_STRVAL_P($input), Z_STRLEN_P($input));
%}
%typemap(out) string %{
@ -63,8 +63,8 @@ namespace std {
%}
%typemap(directorout) string & ($*1_ltype *temp) %{
convert_to_string_ex($input);
temp = new $*1_ltype(Z_STRVAL_PP($input), Z_STRLEN_PP($input));
convert_to_string_ex(&$input);
temp = new $*1_ltype(Z_STRVAL_P($input), Z_STRLEN_P($input));
swig_acquire_ownership(temp);
$result = temp;
%}

View file

@ -80,11 +80,11 @@
%}
%typemap(directorout) TYPE
%{
CONVERT_IN($result,$1_ltype,$input);
CONVERT_IN($result,$1_ltype,&$input);
%}
%typemap(directorout) const TYPE & ($*1_ltype temp)
%{
CONVERT_IN(temp,$*1_ltype,$input);
CONVERT_IN(temp,$*1_ltype,&$input);
$result = &temp;
%}
%enddef