Go to the source code of this file.
◆ _GNU_SOURCE
For using the GNU extension program_invocation_short_name
◆ htils_assert
| #define htils_assert |
( |
|
expr | ) |
|
Value: ((expr) ? (void)0 \
__FILE__, __LINE__, __func__))
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
◆ __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.
Prints the error message to stderr, and then terminates the program using exit().
- Note
- This function should never be run directly, and is run by htils_assert() on a failed assertion.
- Parameters
-
| expr_str | The expression as string. |
| executable | The executable name. |
| file | The file name. |
| line | The line number. |
| func | The function name. |
- See also
- htils_assert(), exit()
◆ program_invocation_short_name
| cstr* program_invocation_short_name |
|
extern |
The name of the program, exposed by the GNU standard.
This variable is exposed by the GNU standard, and is used to get the program name without relying on argv[0].
- Note
- This variable depends on GNU extensions, and is not portable.