htils 1
A small set of utilities for C programming.
Loading...
Searching...
No Matches
assert.h
Go to the documentation of this file.
1#ifndef HTILS_ASSERT_H
2#define HTILS_ASSERT_H
3
4//
5//
6//
7
9#define _GNU_SOURCE
10
11//
12//
13//
14
15#include <htils/basictypes.h>
16
17//
18//
19//
20
30
31//
32//
33//
34
54_Noreturn void __htils_assert_fail(const cstr *expr_str, const cstr *executable,
55 const cstr *file, u32 line,
56 const cstr *func);
57
58#define htils_assert(expr) \
59 ((expr) ? (void)0 \
60 : __htils_assert_fail(#expr, program_invocation_short_name, \
61 __FILE__, __LINE__, __func__))
62
63#endif // !DAPPIE_ASSERT_H
cstr * program_invocation_short_name
The name of the program, exposed by the GNU standard.
_Noreturn void __htils_assert_fail(const cstr *expr_str, const cstr *executable, const cstr *file, u32 line, const cstr *func)
Terminates the program with an error message.
Definition assert.c:11
char cstr
Definition basictypes.h:50
uint32_t u32
Definition basictypes.h:14