29 lines
583 B
C
29 lines
583 B
C
|
#include <defs.h>
|
||
|
#include <stdarg.h>
|
||
|
#include <stdio.h>
|
||
|
#include <ulib.h>
|
||
|
#include <error.h>
|
||
|
|
||
|
void
|
||
|
__panic(const char *file, int line, const char *fmt, ...) {
|
||
|
// print the 'message'
|
||
|
va_list ap;
|
||
|
va_start(ap, fmt);
|
||
|
cprintf("user panic at %s:%d:\n ", file, line);
|
||
|
vcprintf(fmt, ap);
|
||
|
cprintf("\n");
|
||
|
va_end(ap);
|
||
|
exit(-E_PANIC);
|
||
|
}
|
||
|
|
||
|
void
|
||
|
__warn(const char *file, int line, const char *fmt, ...) {
|
||
|
va_list ap;
|
||
|
va_start(ap, fmt);
|
||
|
cprintf("user warning at %s:%d:\n ", file, line);
|
||
|
vcprintf(fmt, ap);
|
||
|
cprintf("\n");
|
||
|
va_end(ap);
|
||
|
}
|
||
|
|