Lua improvements - Mark Gossage patch #1295168
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7476 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
b4a56ba679
commit
bf48768e04
5 changed files with 442 additions and 0 deletions
17
Lib/lua/std_except.i
Normal file
17
Lib/lua/std_except.i
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// Typemaps used by the STL wrappers that throw exceptions.
|
||||
// These typemaps are used when methods are declared with an STL exception specification, such as
|
||||
// size_t at() const throw (std::out_of_range);
|
||||
|
||||
%{
|
||||
#include <stdexcept>
|
||||
%}
|
||||
%include "exception.i"
|
||||
|
||||
%typemap(throws) std::out_of_range %{
|
||||
SWIG_exception(SWIG_IndexError, $1.what()); %}
|
||||
|
||||
%typemap(throws) std::exception %{
|
||||
SWIG_exception(SWIG_SystemError, $1.what()); %}
|
||||
|
||||
%typemap(throws) std::exception& %{
|
||||
SWIG_exception(SWIG_SystemError, ($1)->what()); %}
|
||||
Loading…
Add table
Add a link
Reference in a new issue