12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- #if defined(SWIGJAVA) || defined(SWIGCSHARP) || defined(SWIGGUILE) || defined(SWIGUTL) || defined(SWIGD)
- #error "This version of std_except.i should not be used"
- #endif
- %{
- #include <stdexcept>
- %}
- %include <exception.i>
- %define %std_exception_map(Exception, Code)
- %typemap(throws,noblock=1) Exception {
- SWIG_exception(Code, $1.what());
- }
- %ignore Exception;
- struct Exception {
- };
- %enddef
- namespace std {
- %std_exception_map(bad_exception, SWIG_SystemError);
- %std_exception_map(domain_error, SWIG_ValueError);
- %std_exception_map(exception, SWIG_SystemError);
- %std_exception_map(invalid_argument, SWIG_ValueError);
- %std_exception_map(length_error, SWIG_IndexError);
- %std_exception_map(logic_error, SWIG_RuntimeError);
- %std_exception_map(out_of_range, SWIG_IndexError);
- %std_exception_map(overflow_error, SWIG_OverflowError);
- %std_exception_map(range_error, SWIG_OverflowError);
- %std_exception_map(runtime_error, SWIG_RuntimeError);
- %std_exception_map(underflow_error, SWIG_OverflowError);
- }
|