Better workaround for Scilab name problem with 'Error'

This commit is contained in:
William S Fulton 2013-09-17 20:25:19 +01:00
parent 228b7d9a6c
commit f994bc481d
1 changed files with 3 additions and 9 deletions

View File

@ -1,20 +1,14 @@
%module constructor_exception %module constructor_exception
#ifdef SWIGSCILAB
%inline %{ %inline %{
#undef Error class MyError {
%}
#endif
%inline %{
class Error {
}; };
class SomeClass { class SomeClass {
public: public:
SomeClass(int x) { SomeClass(int x) {
if (x < 0) { if (x < 0) {
throw Error(); throw MyError();
} }
} }
}; };
@ -23,7 +17,7 @@ class Test {
SomeClass o; SomeClass o;
public: public:
Test(int x) try : o(x) { } Test(int x) try : o(x) { }
catch (Error &) { catch (MyError &) {
} }
catch (int) { catch (int) {
} }