reldb 0.1.0
Recreational SQLite
Loading...
Searching...
No Matches
Debugging & Context

Assertions and context printing utilities. More...

Macros

#define debug_break()
#define ASSERT(expr)
 Standard runtime assertion. Triggers a debug break on failure.
#define ASSERT_NOT_NULL(ptr)
 Asserts that a pointer is not NULL.

Functions

static void print_context_info (void)
 Prints the OS, Architecture, and Compiler to stdout.

Detailed Description

Assertions and context printing utilities.

Macro Definition Documentation

◆ ASSERT

#define ASSERT ( expr)
Value:
do { \
if (!(expr)) { \
fputs("Assertion failed: " #expr "\n", stderr); \
fputs("File: " __FILE__ "\n", stderr); \
fputs("Line: " STRINGIFY(__LINE__) "\n", stderr); \
debug_break(); \
} \
} while (0)

Standard runtime assertion. Triggers a debug break on failure.

Parameters
exprThe expression that must evaluate to true.

Definition at line 270 of file macros.h.

◆ ASSERT_NOT_NULL

#define ASSERT_NOT_NULL ( ptr)
Value:
do { \
if ((ptr) == NULL) { \
fputs("Assertion failed: " #ptr " is NULL\n", stderr); \
fputs("File: " __FILE__ "\n", stderr); \
fputs("Line: " STRINGIFY(__LINE__) "\n", stderr); \
debug_break(); \
} \
} while (0)
void * ptr
Definition types.h:82

Asserts that a pointer is not NULL.

Parameters
ptrThe pointer to check.

Definition at line 284 of file macros.h.

◆ debug_break

#define debug_break ( )
Value:
(*(volatile int *)0 = 0)

Definition at line 262 of file macros.h.

Function Documentation

◆ print_context_info()

void print_context_info ( void )
inlinestatic

Prints the OS, Architecture, and Compiler to stdout.

< Marks a function/variable as internal to the translation unit

Definition at line 246 of file macros.h.