summaryrefslogtreecommitdiff
path: root/stdafx.h
diff options
context:
space:
mode:
authorDwight <dmerriman@gmail.com>2008-02-10 16:28:48 -0500
committerDwight <dmerriman@gmail.com>2008-02-10 16:28:48 -0500
commit329020083a639d04c052a1a46d8c25d908d74d06 (patch)
treee46c4433c691ffce57d69a170a4327f2cdd6cdda /stdafx.h
parent43c52c96ad105efbe329b62ab7e54b0cb5e9f811 (diff)
downloadmongo-329020083a639d04c052a1a46d8c25d908d74d06.tar.gz
assertions etc.
Diffstat (limited to 'stdafx.h')
-rw-r--r--stdafx.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/stdafx.h b/stdafx.h
index ec77a0693e8..f362852a261 100644
--- a/stdafx.h
+++ b/stdafx.h
@@ -9,7 +9,21 @@ const bool debug=true;
#include "targetver.h"
-#include "assert.h"
+//#include "assert.h"
+
+// you can catch these
+class AssertionException {
+public:
+ AssertionException() { }
+};
+
+void asserted(const char *msg, const char *file, unsigned line);
+#define assert(_Expression) (void)( (!!(_Expression)) || (asserted(#_Expression, __FILE__, __LINE__), 0) )
+
+#define xassert(_Expression) (void)( (!!(_Expression)) || (asserted(#_Expression, __FILE__, __LINE__), 0) )
+
+#define yassert 1
+
#include <stdio.h>
#include <sstream>