c-utils

Panic (v0.0.2)

Functions and macros to deal with unrecoverable errors.

panicif(1 == 1, "one is one"); // panics

panic("this will panic");

API Docs

panic

Unconditionally panic and abort.

panic("unrecoverable error");

panicif

Panic and abort if a condition is true.

int x = 1;
panicif(x == 1, "x is 1");

panicdbg

Panic and abort if a condition is true, only in debug builds.

int y = 0;
panicdbg(y == 0, "y is 0, only panics in debug");