src/common.h

changeset 513
29eb671b34f6
parent 498
791c831c8020
child 515
a0ad72800b96
--- a/src/common.h	Fri Oct 18 18:16:54 2013 +0300
+++ b/src/common.h	Fri Oct 18 21:52:09 2013 +0300
@@ -25,7 +25,6 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <assert.h>
 #include <stdint.h>
 #include <stdarg.h>
 #include <QString>
@@ -75,10 +74,6 @@
 # define DIRSLASH_CHAR '/'
 #endif // WIN32
 
-#ifdef RELEASE
-# define NDEBUG // remove asserts
-#endif // RELEASE
-
 #define PROP_NAME(GET) m_##GET
 
 #define READ_ACCESSOR(T, GET) \
@@ -144,12 +139,17 @@
 
 // Replace assert with a version that shows a GUI dialog if possible.
 // On Windows I just can't get the actual error messages otherwise.
+void assertionFailure (const char* file, int line, const char* funcname, const char* expr);
+
 #ifdef assert
-#undef assert
+# undef assert
 #endif // assert
 
-void assertionFailure (const char* file, int line, const char* funcname, const char* expr);
-#define assert(N) ((N) ? (void) 0 : assertionFailure (__FILE__, __LINE__, FUNCNAME, #N))
+#ifdef DEBUG
+# define assert(N) ((N) ? (void) 0 : assertionFailure (__FILE__, __LINE__, FUNCNAME, #N))
+#else
+# define assert(N)
+#endif // DEBUG
 
 // Version string identifier
 QString versionString();

mercurial