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

@ -75,19 +75,15 @@
%}
%typemap(directorout) TYPE
%{
if (!EG(exception)) {
CONVERT_IN($result, $1_ltype, *$input);
}
CONVERT_IN($result, $1_ltype, *$input);
%}
%typemap(directorout) const TYPE &
%{
$*1_ltype swig_val;
if (!EG(exception)) {
CONVERT_IN(swig_val, $*1_ltype, *$input);
$1_ltype temp = new $*1_ltype(($*1_ltype)swig_val);
swig_acquire_ownership(temp);
$result = temp;
}
CONVERT_IN(swig_val, $*1_ltype, *$input);
$1_ltype temp = new $*1_ltype(($*1_ltype)swig_val);
swig_acquire_ownership(temp);
$result = temp;
%}
%typemap(directorfree) const TYPE &
%{