aboutsummaryrefslogtreecommitdiff
path: root/bootstrap/rtl/fail.c
blob: e304642ceda60222a1146b506a87bc3a1c3e81ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

/*
 * Minimal bootstrap RTL (runtime library) - Failure handling.
 *
 * Copyright © 2025 Samuel Lidén Borell <samuel@kodafritt.se>
 *
 * SPDX-License-Identifier: EUPL-1.2+ OR LGPL-2.1-or-later OR MIT-0
 */
#include <stdlib.h>
#include <stdio.h>
#include "rtl.h"

SLUL_NORETURN void SLUL_assert_fail(const char *expr, const char *file,
                                    int line)
{
    fprintf(stderr, "%s:%d: Assertion `%s` failed.\n", file, line, expr);
    abort();
}