diff options
Diffstat (limited to 'lout')
-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); |