diff options
Diffstat (limited to 'libddekit/include/ddekit')
-rw-r--r-- | libddekit/include/ddekit/panic.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/libddekit/include/ddekit/panic.h b/libddekit/include/ddekit/panic.h index 1468675f..11c46ebb 100644 --- a/libddekit/include/ddekit/panic.h +++ b/libddekit/include/ddekit/panic.h @@ -3,14 +3,29 @@ /** \defgroup DDEKit_util */ +#include <stdio.h> + /** Panic - print error message and enter the kernel debugger. * \ingroup DDEKit_util */ -void ddekit_panic(char *fmt, ...) __attribute__((noreturn)); +#define ddekit_panic(format, ...) do \ +{ \ + char buf[1024]; \ + snprintf (buf, 1024, "%s", format); \ + fprintf (stderr , buf, ## __VA_ARGS__); \ + fflush (stderr); \ + abort (); \ +} while (0) /** Print a debug message. * \ingroup DDEKit_util */ -void ddekit_debug(char *fmt, ...); +#define ddekit_debug(format, ...) do \ +{ \ + char buf[1024]; \ + snprintf (buf, 1024, "%s: %s\n", __func__, format); \ + fprintf (stderr , buf, ## __VA_ARGS__); \ + fflush (stderr); \ +} while (0) #endif |