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
29
extern
cstr
*
program_invocation_short_name
;
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
program_invocation_short_name
cstr * program_invocation_short_name
The name of the program, exposed by the GNU standard.
__htils_assert_fail
_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
basictypes.h
cstr
char cstr
Definition
basictypes.h:50
u32
uint32_t u32
Definition
basictypes.h:14
include
htils
assert.h
Generated by
1.9.8