Update assert rule.
authorBrian Aker <brian@tangent.org>
Tue, 8 Jan 2013 03:58:53 +0000 (22:58 -0500)
committerBrian Aker <brian@tangent.org>
Tue, 8 Jan 2013 03:58:53 +0000 (22:58 -0500)
libmemcached/assert.hpp

index f2fc158d88a761172044b9c1a3e0d19e6e64e6e4..b7124c91d7d70fbd12184d1548d628ef6f35ceaf 100644 (file)
 
 #pragma once
 
-#ifdef _WIN32
-# include <malloc.h>
+#ifdef NDEBUG
+# define assert_msg(__expr, __mesg) (void)(__expr); (void)(__mesg);
+# define assert_vmsg(__expr, __mesg, ...) (void)(__expr); (void)(__mesg);
 #else
-# include <alloca.h>
-#endif
 
-#include <cstdarg>
+# ifdef _WIN32
+#  include <malloc.h>
+# else
+#  include <alloca.h>
+# endif
 
-#ifdef NDEBUG
-#define assert_msg(__expr, __mesg) (void)(__expr); (void)(__mesg);
-#define assert_vmsg(__expr, __mesg, ...) (void)(__expr); (void)(__mesg);
-#else
+# include <cstdarg>
+# include <libmemcached/backtrace.hpp>
 
-#define assert_msg(__expr, __mesg) \
+# define assert_msg(__expr, __mesg) \
 do \
 { \
   if (not (__expr)) \
@@ -61,7 +62,7 @@ do \
   } \
 } while (0)
 
-#define assert_vmsg(__expr, __mesg, ...) \
+# define assert_vmsg(__expr, __mesg, ...) \
 do \
 { \
   if (not (__expr)) \
@@ -76,4 +77,4 @@ do \
   } \
 } while (0)
 
-#endif
+#endif // NDEBUG