X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/55e6d07cfba4948a918765e9d6fd2801d3639a4a..ad455a31635e6f71bb8dd5c06d85657812c783bd:/src/simgrid/Exception.cpp diff --git a/src/simgrid/Exception.cpp b/src/simgrid/Exception.cpp index cd4fc1fa22..ed0a7e9fa1 100644 --- a/src/simgrid/Exception.cpp +++ b/src/simgrid/Exception.cpp @@ -9,6 +9,11 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix_context); namespace simgrid { +// DO NOT define destructors for exceptions in Exception.hpp. +// Defining it here ensures that the exceptions are defined only in libsimgrid, but not in libsimgrid-java. +// Doing otherwise naturally breaks things (at least on freebsd with clang). + +Exception::~Exception() = default; ForcefulKillException::~ForcefulKillException() = default; void ForcefulKillException::do_throw() @@ -16,7 +21,7 @@ void ForcefulKillException::do_throw() throw ForcefulKillException(); } -bool ForcefulKillException::try_n_catch(std::function try_block) +bool ForcefulKillException::try_n_catch(const std::function& try_block) { bool res; try {