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
|
|
@ -18,22 +18,7 @@ namespace Swig {
|
|||
|
||||
%include "std_string.i"
|
||||
|
||||
#ifdef SWIGPHP
|
||||
|
||||
%feature("director:except") {
|
||||
if ($error == FAILURE) {
|
||||
Swig::DirectorMethodException::raise("$symname");
|
||||
}
|
||||
}
|
||||
|
||||
%exception {
|
||||
try { $action }
|
||||
catch (Swig::DirectorException &) { SWIG_fail; }
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef SWIGPYTHON
|
||||
#if defined SWIGPHP || defined SWIGPYTHON
|
||||
|
||||
%feature("director:except") {
|
||||
if ($error != NULL) {
|
||||
|
|
|
|||
|
|
@ -17,11 +17,7 @@
|
|||
%feature("director") Foo;
|
||||
|
||||
%feature("director:except") {
|
||||
#ifndef SWIGPHP
|
||||
if ($error != NULL) {
|
||||
#else
|
||||
if ($error == FAILURE) {
|
||||
#endif
|
||||
throw Swig::DirectorMethodException();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue