diff options
author | Dwight <dmerriman@gmail.com> | 2008-02-10 16:28:48 -0500 |
---|---|---|
committer | Dwight <dmerriman@gmail.com> | 2008-02-10 16:28:48 -0500 |
commit | 329020083a639d04c052a1a46d8c25d908d74d06 (patch) | |
tree | e46c4433c691ffce57d69a170a4327f2cdd6cdda /stdafx.h | |
parent | 43c52c96ad105efbe329b62ab7e54b0cb5e9f811 (diff) | |
download | mongo-329020083a639d04c052a1a46d8c25d908d74d06.tar.gz |
assertions etc.
Diffstat (limited to 'stdafx.h')
-rw-r--r-- | stdafx.h | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -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>
|