Add raise methods for throwing c++ exceptions in C#, Java, D
The director c++ exceptions are thrown in a helper method instead of in the director overloaded method. This circumvents compiler warnings about throwing exceptions when the method has an exception specification or noexcept. If the exception is thrown, abort will still be called! In Java, the "director:noexcept" typemap can be used to do something else. This typemap should be ported to the other languages too.
This commit is contained in:
parent
971404485f
commit
07ab80b49e
7 changed files with 29 additions and 5 deletions
|
|
@ -4490,7 +4490,7 @@ public:
|
|||
Printf(directorexcept, "jthrowable $error = jenv->ExceptionOccurred();\n");
|
||||
Printf(directorexcept, "if ($error) {\n");
|
||||
Printf(directorexcept, " jenv->ExceptionClear();$directorthrowshandlers\n");
|
||||
Printf(directorexcept, " throw Swig::DirectorException(jenv, $error);\n");
|
||||
Printf(directorexcept, " Swig::DirectorException::raise(jenv, $error);\n");
|
||||
Printf(directorexcept, "}\n");
|
||||
} else {
|
||||
directorexcept = Copy(directorexcept);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue