(debug): New.

(main): Set it on -d.
(oops, CANT_HAPPEN): New.
This commit is contained in:
Markus Armbruster 2004-04-02 15:40:43 +00:00
parent f1edf905e9
commit 47c8a32ae3
4 changed files with 29 additions and 1 deletions

View file

@ -99,3 +99,15 @@ logerror(s_char *format, ...)
#endif
va_end(list);
}
/*
* Log internal error MSG occured in FILE:LINE.
* If debugging, call abort(), else return 1.
*/
int
oops(char *msg, char *file, int line)
{
logerror("Oops: %s in %s:%d\n", msg, file, line);
if (debug) abort();
return 1;
}