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:
parent
10d87100ea
commit
50426aae20
8 changed files with 50 additions and 88 deletions
|
|
@ -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 & %{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue