FD.io VPP  v20.05.1-5-g09f167997
Vector Packet Processing
error_bootstrap.h File Reference
+ Include dependency graph for error_bootstrap.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define clib_error_function   ((char *) __FUNCTION__)
 
#define CLIB_ASSERT_ENABLE   (CLIB_DEBUG > 0)
 
#define ASSERT(truth)
 
#define ALWAYS_ASSERT(truth)
 
#define STATIC_ASSERT(truth, ...)   _Static_assert(truth, __VA_ARGS__)
 
#define STATIC_ASSERT_SIZEOF(d, s)   STATIC_ASSERT (sizeof (d) == s, "Size of " #d " must be " # s " bytes")
 
#define STATIC_ASSERT_SIZEOF_ELT(d, e, s)   STATIC_ASSERT (sizeof (((d *)0)->e) == s, "Size of " #d "." #e " must be " # s " bytes")
 
#define STATIC_ASSERT_OFFSET_OF(s, e, o)   STATIC_ASSERT (STRUCT_OFFSET_OF(s,e) == o, "Offset of " #s "." #e " must be " # o)
 
#define STATIC_ASSERT_FITS_IN(s, e, o)
 
#define ASSERT_AND_PANIC(truth)
 

Enumerations

enum  {
  CLIB_ERROR_FATAL = 1 << 0, CLIB_ERROR_ABORT = 1 << 1, CLIB_ERROR_WARNING = 1 << 2, CLIB_ERROR_ERRNO_VALID = 1 << 16,
  CLIB_ERROR_NO_RATE_LIMIT = 1 << 17
}
 

Macro Definition Documentation

◆ ALWAYS_ASSERT

#define ALWAYS_ASSERT (   truth)
Value:
do { \
if (PREDICT_FALSE(!(truth))) \
{ \
_clib_error (CLIB_ERROR_ABORT, 0, 0, \
"%s:%d (%s) assertion `%s' fails", \
__FILE__, \
(uword) __LINE__, \
# truth); \
} \
} while (0)
#define clib_error_function
#define PREDICT_FALSE(x)
Definition: clib.h:118
u64 uword
Definition: types.h:112

Definition at line 89 of file error_bootstrap.h.

◆ ASSERT

#define ASSERT (   truth)
Value:
do { \
if (CLIB_ASSERT_ENABLE && ! (truth)) \
{ \
_clib_error (CLIB_ERROR_ABORT, 0, 0, \
"%s:%d (%s) assertion `%s' fails", \
__FILE__, \
(uword) __LINE__, \
# truth); \
} \
} while (0)
#define clib_error_function
#define CLIB_ASSERT_ENABLE
u64 uword
Definition: types.h:112

Definition at line 69 of file error_bootstrap.h.

◆ ASSERT_AND_PANIC

#define ASSERT_AND_PANIC (   truth)
Value:
do { \
if (CLIB_ASSERT_ENABLE && ! (truth)) \
os_panic (); \
} while (0)
#define CLIB_ASSERT_ENABLE

Definition at line 131 of file error_bootstrap.h.

◆ CLIB_ASSERT_ENABLE

#define CLIB_ASSERT_ENABLE   (CLIB_DEBUG > 0)

Definition at line 59 of file error_bootstrap.h.

◆ clib_error_function

#define clib_error_function   ((char *) __FUNCTION__)

Definition at line 56 of file error_bootstrap.h.

◆ STATIC_ASSERT

#define STATIC_ASSERT (   truth,
  ... 
)    _Static_assert(truth, __VA_ARGS__)

Definition at line 114 of file error_bootstrap.h.

◆ STATIC_ASSERT_FITS_IN

#define STATIC_ASSERT_FITS_IN (   s,
  e,
 
)
Value:
STATIC_ASSERT (STRUCT_OFFSET_OF(s,e) <= (o - sizeof(((s *)0)->e)), \
#s "." #e " does not fit into " # o " bytes")
#define STRUCT_OFFSET_OF(t, f)
Definition: clib.h:69
#define STATIC_ASSERT(truth,...)

Definition at line 126 of file error_bootstrap.h.

◆ STATIC_ASSERT_OFFSET_OF

#define STATIC_ASSERT_OFFSET_OF (   s,
  e,
 
)    STATIC_ASSERT (STRUCT_OFFSET_OF(s,e) == o, "Offset of " #s "." #e " must be " # o)

Definition at line 123 of file error_bootstrap.h.

◆ STATIC_ASSERT_SIZEOF

#define STATIC_ASSERT_SIZEOF (   d,
 
)    STATIC_ASSERT (sizeof (d) == s, "Size of " #d " must be " # s " bytes")

Definition at line 117 of file error_bootstrap.h.

◆ STATIC_ASSERT_SIZEOF_ELT

#define STATIC_ASSERT_SIZEOF_ELT (   d,
  e,
 
)    STATIC_ASSERT (sizeof (((d *)0)->e) == s, "Size of " #d "." #e " must be " # s " bytes")

Definition at line 120 of file error_bootstrap.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
CLIB_ERROR_FATAL 
CLIB_ERROR_ABORT 
CLIB_ERROR_WARNING 
CLIB_ERROR_ERRNO_VALID 
CLIB_ERROR_NO_RATE_LIMIT 

Definition at line 46 of file error_bootstrap.h.