summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam S Fulton <wsf@fultondesigns.co.uk>2019-06-07 19:55:15 +0100
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2019-06-27 07:40:49 +0100
commit5c1c69d14040bc5e04d4682f43ceeb45af93e1ca (patch)
treec03872a6da28f119ac3cd2c69baa4d4128922d4b
parentf3357f1f5709f6008418f839cca336250c807841 (diff)
downloadswig-5c1c69d14040bc5e04d4682f43ceeb45af93e1ca.tar.gz
Replace std::unexpected_handler with std::terminate_handler to be c++17 compliant
Closes #1538
-rw-r--r--Lib/python/director.swg11
-rw-r--r--Lib/ruby/director.swg10
2 files changed, 10 insertions, 11 deletions
diff --git a/Lib/python/director.swg b/Lib/python/director.swg
index 4bdc94dc2..36df302f1 100644
--- a/Lib/python/director.swg
+++ b/Lib/python/director.swg
@@ -219,7 +219,7 @@ namespace Swig {
PyErr_Print();
std::cerr << std::endl;
- std::cerr << "This exception was caught by the SWIG unexpected exception handler." << std::endl
+ std::cerr << "This exception was caught by the SWIG UnknownExceptionHandler." << std::endl
<< "Try using %feature(\"director:except\") to avoid reaching this point." << std::endl
<< std::endl
<< "Exception is being re-thrown, program will likely abort/terminate." << std::endl;
@@ -227,14 +227,13 @@ namespace Swig {
}
public:
-
- std::unexpected_handler old;
- UnknownExceptionHandler(std::unexpected_handler nh = handler) {
- old = std::set_unexpected(nh);
+ std::terminate_handler old;
+ UnknownExceptionHandler(std::terminate_handler nh = handler) {
+ old = std::set_terminate(nh);
}
~UnknownExceptionHandler() {
- std::set_unexpected(old);
+ std::set_terminate(old);
}
#endif
};
diff --git a/Lib/ruby/director.swg b/Lib/ruby/director.swg
index c6c53a343..a0569785f 100644
--- a/Lib/ruby/director.swg
+++ b/Lib/ruby/director.swg
@@ -170,7 +170,7 @@ namespace Swig {
std::cerr << std::endl
<< "Ruby interpreter traceback:" << std::endl;
std::cerr << std::endl;
- std::cerr << "This exception was caught by the SWIG unexpected exception handler." << std::endl
+ std::cerr << "This exception was caught by the SWIG UnknownExceptionHandler." << std::endl
<< "Try using %feature(\"director:except\") to avoid reaching this point." << std::endl
<< std::endl
<< "Exception is being re-thrown, program will like abort/terminate." << std::endl;
@@ -178,13 +178,13 @@ namespace Swig {
}
public:
- std::unexpected_handler old;
- UnknownExceptionHandler(std::unexpected_handler nh = handler) {
- old = std::set_unexpected(nh);
+ std::terminate_handler old;
+ UnknownExceptionHandler(std::terminate_handler nh = handler) {
+ old = std::set_terminate(nh);
}
~UnknownExceptionHandler() {
- std::set_unexpected(old);
+ std::set_terminate(old);
}
#endif
};