1
0
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:
Greg King
2019-11-10 12:46:01 -05:00
parent 7f7db01e25
commit ac4866c027
2 changed files with 18 additions and 17 deletions
+3 -4
View File
@@ -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);
}