diff options
author | couriersud <couriersud@gmx.org> | 2019-11-13 07:41:20 +0100 |
---|---|---|
committer | couriersud <couriersud@gmx.org> | 2019-11-13 07:41:20 +0100 |
commit | f4cf0cc86a06f07f4df18fbf521abf3126721d24 (patch) | |
tree | 49d760d161a5a3c981f7ab02c39e6101a535b92c /src/lib/netlist/plib/pexception.h | |
parent | 6a57025550e2898954fe10b5796ad55513a21049 (diff) |
netlist: code maintenance. (nw)
- move memory pool to netlist_state_t removing one static allocation.
- add memory allocation stats to verbose output
- nl_assert no longer throws, first step to remove NL_EXCEPT macro.
Diffstat (limited to 'src/lib/netlist/plib/pexception.h')
-rw-r--r-- | src/lib/netlist/plib/pexception.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/lib/netlist/plib/pexception.h b/src/lib/netlist/plib/pexception.h index 7317a320e28..f237f06e759 100644 --- a/src/lib/netlist/plib/pexception.h +++ b/src/lib/netlist/plib/pexception.h @@ -13,13 +13,22 @@ #include <exception> +#define passert_always(expr) \ + ((expr) ? static_cast<void>(0) : plib::passert_fail (#expr, __FILE__, __LINE__, nullptr)) + +#define passert_always_msg(expr, msg) \ + ((expr) ? static_cast<void>(0) : plib::passert_fail (#expr, __FILE__, __LINE__, msg)) + namespace plib { /// \brief Terminate the program. /// /// \note could be enhanced by setting a termination handler /// - [[noreturn]] void terminate(const pstring &msg) noexcept; + [[noreturn]] void terminate(const char *msg) noexcept; + + [[noreturn]] void passert_fail(const char *assertion, + const char *file, int lineno, const char *msg) noexcept; /// \brief throw an exception. /// |