htils 1
A small set of utilities for C programming.
Loading...
Searching...
No Matches
assert.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <htils/assert.h>
#include <htils/basictypes.h>

Functions

_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.
 

Function Documentation

◆ __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_strThe expression as string.
executableThe executable name.
fileThe file name.
lineThe line number.
funcThe function name.
See also
htils_assert(), exit()