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
#ifdef SWIGSCILAB
%inline %{
#undef Error
%}
#endif
%inline %{
class Error {
class MyError {
};
class SomeClass {
public:
SomeClass(int x) {
if (x < 0) {
throw Error();
throw MyError();
}
}
};
@ -23,7 +17,7 @@ class Test {
SomeClass o;
public:
Test(int x) try : o(x) { }
catch (Error &) {
catch (MyError &) {
}
catch (int) {
}