MentOS  0.8.0
The Mentoring Operating System
Macros | Functions
assert.h File Reference

Defines the function and pre-processor macro for assertions. More...

Go to the source code of this file.

Macros

#define __FILENAME__   (__builtin_strrchr(__FILE__, '/') ? __builtin_strrchr(__FILE__, '/') + 1 : __FILE__)
 Extract the filename from the full path provided by FILE.
 
#define assert(expression)   ((expression) ? (void)0 : __assert_fail(#expression, __FILENAME__, __func__, __LINE__))
 Assert function.
 

Functions

void __assert_fail (const char *assertion, const char *file, const char *function, unsigned int line)
 Function used to log the information of a failed assertion. More...
 

Detailed Description

Defines the function and pre-processor macro for assertions.

Function Documentation

◆ __assert_fail()

void __assert_fail ( const char *  assertion,
const char *  file,
const char *  function,
unsigned int  line 
)

Function used to log the information of a failed assertion.

Parameters
assertionThe failed assertion.
fileThe file where the assertion is located.
functionThe function where the assertion is.
lineThe line inside the file.