FFmpeg  2.8.4
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros
avassert.h File Reference

simple assert() macros that are a bit more flexible than ISO C assert(). More...

#include <stdlib.h>
#include "avutil.h"
#include "log.h"

Go to the source code of this file.

Macros

#define av_assert0(cond)
 assert() equivalent, that is always enabled. More...
 
#define av_assert1(cond)   ((void)0)
 assert() equivalent, that does not lie in speed critical code. More...
 
#define av_assert2(cond)   ((void)0)
 assert() equivalent, that does lie in speed critical code. More...
 

Detailed Description

simple assert() macros that are a bit more flexible than ISO C assert().

Author
Michael Niedermayer micha.nosp@m.elni.nosp@m.@gmx..nosp@m.at

Definition in file avassert.h.

Macro Definition Documentation

#define av_assert0 (   cond)
Value:
do { \
if (!(cond)) { \
av_log(NULL, AV_LOG_PANIC, "Assertion %s failed at %s:%d\n", \
AV_STRINGIFY(cond), __FILE__, __LINE__); \
abort(); \
} \
} while (0)
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
#define AV_LOG_PANIC
Something went really wrong and we will crash now.
Definition: log.h:163
#define AV_STRINGIFY(s)
Definition: macros.h:36

assert() equivalent, that is always enabled.

Examples:
muxing.c, and transcode_aac.c.

Definition at line 37 of file avassert.h.

Referenced by init_resampler(), and write_audio_frame().

#define av_assert1 (   cond)    ((void)0)

assert() equivalent, that does not lie in speed critical code.

These asserts() thus can be enabled without fearing speedloss.

Definition at line 53 of file avassert.h.

#define av_assert2 (   cond)    ((void)0)

assert() equivalent, that does lie in speed critical code.

Definition at line 63 of file avassert.h.