YetAnotherCoupler 3.5.2
Loading...
Searching...
No Matches
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 19 of file yac_assert.h.

Function Documentation

◆ yac_abort_message()

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