YetAnotherCoupler 3.2.0_a
Loading...
Searching...
No Matches
Macros | Functions
yac_assert.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define die(msg)    yac_abort_message((msg), __FILE__, __LINE__)
 
#define YAC_ASSERT(exp, msg)    {if(!((exp))) yac_abort_message(((msg)), __FILE__, __LINE__);}
 
#define YAC_ASSERT_F(exp, format, ...)
 

Functions

void yac_abort_message (char const *, char const *, int)
 

Macro Definition Documentation

◆ die

#define die (   msg)     yac_abort_message((msg), __FILE__, __LINE__)

Definition at line 12 of file yac_assert.h.

◆ YAC_ASSERT

#define YAC_ASSERT (   exp,
  msg 
)     {if(!((exp))) yac_abort_message(((msg)), __FILE__, __LINE__);}

◆ YAC_ASSERT_F

#define YAC_ASSERT_F (   exp,
  format,
  ... 
)
Value:
{ \
if(!((exp))) { \
char msg_buffer[1024]; \
int ret = snprintf( \
msg_buffer, sizeof(msg_buffer), ((format)), __VA_ARGS__); \
if ((ret >= 0) && ((size_t)ret < sizeof(msg_buffer))) \
yac_abort_message(((msg_buffer)), __FILE__, __LINE__); \
else \
yac_abort_message( \
"an error occured, but error message could not be " \
"generated", __FILE__, __LINE__); \
} \
}

Definition at line 18 of file yac_assert.h.

Function Documentation

◆ yac_abort_message()

void yac_abort_message ( char const *  ,
char const *  ,
int   
)
Examples
test_abort_c.c.