diff options
author | Sebastian Geerken <devnull@localhost> | 2016-01-23 12:30:33 +0100 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2016-01-23 12:30:33 +0100 |
commit | 9481d3c3ff40685bf8ef840abbc888cee675ce2e (patch) | |
tree | cd4b7f87fb8a9d8c2d15d675534816bd6eba4fed /lout/misc.hh | |
parent | 7e838b973ac92c0d41fcd2798eb5f569ca274616 (diff) |
SRDOP: Debugging.
Diffstat (limited to 'lout/misc.hh')
-rw-r--r-- | lout/misc.hh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lout/misc.hh b/lout/misc.hh index 24578f02..80f227f8 100644 --- a/lout/misc.hh +++ b/lout/misc.hh @@ -38,6 +38,20 @@ inline void assertNotReached () abort (); } +inline void assertNotReached (const char *fmt, ...) +{ + va_list argp; + va_start(argp, fmt); + + fprintf (stderr, "*** [%s] This should not happen: ", prgName); + vfprintf(stderr, fmt, argp); + fprintf (stderr, "! ***\n"); + + va_end(argp); + + abort (); +} + inline void notImplemented (const char *name) { fprintf (stderr, "*** [%s] Not implemented: %s ***\n", prgName, name); |