src/macros.h

changeset 129
54f27fa8f32f
parent 125
85814c0918c5
child 130
885fd60e8bf1
--- 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<typename... argtypes>
 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")

mercurial