Roc Toolkit internal modules
Roc Toolkit: real-time audio streaming
panic.h File Reference

Panic. More...

Include dependency graph for panic.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 roc
 Root namespace.
 
 roc::core
 General-purpose building blocks and platform abstraction layer.
 

Macros

#define roc_panic_if(x)
 Panic if condition is true. More...
 
#define roc_panic_if_not(x)   roc_panic_if(!(x))
 Panic if condition is false. More...
 
#define roc_panic_if_msg(x, ...)
 Panic if condition is true, printing custom message. More...
 
#define roc_panic(...)    ::roc::core::panic(ROC_STRINGIZE(ROC_MODULE), __FILE__, __LINE__, __VA_ARGS__)
 Print error message and terminate program gracefully. More...
 

Functions

void roc::core::panic (const char *module, const char *file, int line, const char *format,...)
 Print error message and terminate program gracefully. More...
 

Detailed Description

Panic.

Definition in file panic.h.

Macro Definition Documentation

◆ roc_panic

#define roc_panic (   ...)     ::roc::core::panic(ROC_STRINGIZE(ROC_MODULE), __FILE__, __LINE__, __VA_ARGS__)

Print error message and terminate program gracefully.

Remarks
Never returns and never throws.

Definition at line 50 of file panic.h.

◆ roc_panic_if

#define roc_panic_if (   x)
Value:
do { \
if ((x)) { \
roc_panic("%s", #x); \
} \
} while (0)

Panic if condition is true.

Note
This is a shorthand; roc_panic() with a meaningful error message is preferred way to panic.

Definition at line 26 of file panic.h.

◆ roc_panic_if_msg

#define roc_panic_if_msg (   x,
  ... 
)
Value:
do { \
if ((x)) { \
roc_panic(__VA_ARGS__); \
} \
} while (0)

Panic if condition is true, printing custom message.

Definition at line 40 of file panic.h.

◆ roc_panic_if_not

#define roc_panic_if_not (   x)    roc_panic_if(!(x))

Panic if condition is false.

Note
This is a shorthand; roc_panic() with a meaningful error message is preferred way to panic.

Definition at line 37 of file panic.h.