summaryrefslogtreecommitdiff
path: root/src/assert/__assert.c
blob: 0a3f95c33b0b276c891a2ac64c91163eb65b99e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <stdio.h>
#include <stdlib.h>
#include "_safety.h"

void __assert(const char *expr, const char *file, int line, const char *func)
{
	SIGNAL_SAFE(0);

        if (func) {
                fprintf(stderr, "Assertion failed: %s (%s:%d:%s())\n", expr,
                        file, line, func);
        } else {
                fprintf(stderr, "Assertion failed: %s (%s:%d)\n", expr, file,
                        line);
        }

        abort();
}

/*
STDC(0)
*/