mirror of
https://github.com/cc65/cc65.git
synced 2026-04-25 22:18:27 +00:00
Made assert() send SIGABRT when an assertion fails.
A signal handler can catch it, and do anything needed to make stderr work.
This commit is contained in:
@@ -2,11 +2,12 @@
|
||||
** _afailed.c
|
||||
**
|
||||
** 1998-06-06, Ullrich von Bassewitz
|
||||
** 2015-03-13, Greg King
|
||||
** 2019-11-10, Greg King
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -14,9 +15,7 @@
|
||||
|
||||
void __fastcall__ _afailed (char* file, unsigned line)
|
||||
{
|
||||
raise (SIGABRT);
|
||||
fprintf (stderr, "ASSERTION FAILED IN %s(%u)\n", file, line);
|
||||
exit (2);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user