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
|
%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) {
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue