# HG changeset patch # User Teemu Piippo # Date 1399217671 -10800 # Node ID 54f27fa8f32f0f9438b6853696142f202fac22ef # Parent 186ebeea2a855bb596b1f4c846ca85d10fe75e97 - expand the asserts into nothingness if not in a debug build diff -r 186ebeea2a85 -r 54f27fa8f32f src/macros.h --- a/src/macros.h Sun May 04 18:31:40 2014 +0300 +++ b/src/macros.h Sun May 04 18:34:31 2014 +0300 @@ -61,8 +61,12 @@ template void error (const char* fmtstr, const argtypes&... args); -#define BOTC_GENERIC_ASSERT(A,B,OP,COMPLAINT) ((A OP B) ? (void) 0 : \ +#ifdef DEBUG +# define BOTC_GENERIC_ASSERT(A,B,OP,COMPLAINT) ((A OP B) ? (void) 0 : \ error ("assertion failed at " __FILE__ ":%1: " #A " (%2) " COMPLAINT " " #B " (%3)", __LINE__, A, B)); +#else +# define BOTC_GENERIC_ASSERT(A,B,OP,COMPLAINT) {} +#endif #define ASSERT_EQ(A,B) BOTC_GENERIC_ASSERT (A, B, ==, "does not equal") #define ASSERT_NE(A,B) BOTC_GENERIC_ASSERT (A, B, !=, "is no different from")