aboutsummaryrefslogtreecommitdiff
path: root/include/assert.h
blob: ad9c2fdb77d6f3f206151114f5daf10514c8f5a0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14

#pragma once

#include <stdio.h>
#include <stdlib.h>

#define assert(condition, ...) \
    do { \
        if (!(condition)) { \
            fprintf(stderr, "Assertion failed: %s:%d in %s(): ", __FILE__, __LINE__, __func__); \
            fprintf(stderr, __VA_ARGS__); \
            fprintf(stderr, "\n"); \
            abort(); \
        } \
    } while (0)