mirror of https://github.com/swig/swig
Better workaround for Scilab name problem with 'Error'
This commit is contained in:
parent
228b7d9a6c
commit
f994bc481d
|
@ -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) {
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue