htils
1
A small set of utilities for C programming.
Toggle main menu visibility
Loading...
Searching...
No Matches
assert.h
Go to the documentation of this file.
1
#ifndef HTILS_ASSERT_H
2
#define HTILS_ASSERT_H
3
5
#define _GNU_SOURCE
6
7
/***********************************/
8
9
#include <
htils/basictypes.h
>
10
11
/***********************************/
12
21
extern
cstr
*
program_invocation_short_name
;
22
42
_Noreturn
void
__htils_assert_fail
(
const
cstr
*expr_str,
const
cstr
*executable,
43
const
cstr
*file,
u32
line,
44
const
cstr
*func);
45
57
#define htils_assert(expr) \
58
((expr) ? (void)0 \
59
: __htils_assert_fail(#expr, program_invocation_short_name, \
60
__FILE__, __LINE__, __func__))
61
62
#endif
// !HTILS_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:59
u32
uint32_t u32
Definition
basictypes.h:19
include
htils
assert.h
Generated by
1.17.0