(debug): New.
(main): Set it on -d. (oops, CANT_HAPPEN): New.
This commit is contained in:
parent
f1edf905e9
commit
47c8a32ae3
4 changed files with 29 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue