Make PHP directors work more like other languages

A PHP exception now gets translated to a C++ exception to skips over C++
code to get back to PHP, avoiding the need to gate every directorout
typemap on EG(exception).
This commit is contained in:
Olly Betts 2021-04-22 14:40:21 +12:00
commit 50426aae20
8 changed files with 50 additions and 88 deletions

View file

@ -33,10 +33,8 @@ namespace std {
%}
%typemap(directorout) string %{
if (!EG(exception)) {
convert_to_string($input);
$result.assign(Z_STRVAL_P($input), Z_STRLEN_P($input));
}
%}
%typemap(out) string %{
@ -74,12 +72,10 @@ namespace std {
%}
%typemap(directorout) string & ($*1_ltype *temp) %{
if (!EG(exception)) {
convert_to_string($input);
temp = new $*1_ltype(Z_STRVAL_P($input), Z_STRLEN_P($input));
swig_acquire_ownership(temp);
$result = temp;
}
%}
%typemap(argout) string & %{