1
0
mirror of https://github.com/cc65/cc65.git synced 2024-09-30 08:57:49 +00:00
cc65/libsrc/common/_afailed.c
Greg King ac4866c027 Made assert() send SIGABRT when an assertion fails.
A signal handler can catch it, and do anything needed to make stderr work.
2019-11-10 12:46:01 -05:00

22 lines
310 B
C

/*
** _afailed.c
**
** 1998-06-06, Ullrich von Bassewitz
** 2019-11-10, Greg King
*/
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
void __fastcall__ _afailed (char* file, unsigned line)
{
raise (SIGABRT);
fprintf (stderr, "ASSERTION FAILED IN %s(%u)\n", file, line);
exit (2);
}