62 |
*/ |
*/ |
63 |
#ifdef ASC_NO_ASSERTIONS |
#ifdef ASC_NO_ASSERTIONS |
64 |
# define asc_assert(x) ((void)0) |
# define asc_assert(x) ((void)0) |
65 |
|
# define ASC_ASSERT_LT(A,B) ((void)0) |
66 |
|
# define ASC_ASSERT_EQ(A,B) ((void)0) |
67 |
|
# define ASC_ASSERT_RANGE(A,B,C) ((void)0) |
68 |
|
|
69 |
#else |
#else |
70 |
# define asc_assert(cond) \ |
# define asc_assert(cond) \ |
86 |
, #A, #B \ |
, #A, #B \ |
87 |
, (float)A, (float)B)) |
, (float)A, (float)B)) |
88 |
|
|
89 |
|
#define ASC_ASSERT_RANGE(A,B,C) \ |
90 |
|
((A) >= (B) && (A) < (C) ? (void)0 : asc_panic_line(ASCERR_ASSERTION_FAILED\ |
91 |
|
, __FILE__, __LINE__, __FUNCTION__\ |
92 |
|
,"Assertion failed: %s < %s < %s (val = %f, low = %f, up = %f)" \ |
93 |
|
, #B, #A, #C \ |
94 |
|
, (float)A, (float)B), (float)C) |
95 |
|
|
96 |
#endif |
#endif |
97 |
|
|
98 |
/**< Print fatal error message, run callback function & (usually) exit the program. |
/**< Print fatal error message, run callback function & (usually) exit the program. |