Browse Source

Moved bbAssert to its own file.

Mark Sibly 9 years ago
parent
commit
3b39ef4367
2 changed files with 24 additions and 0 deletions
  1. 7 0
      modules/monkey/native/bbassert.cpp
  2. 17 0
      modules/monkey/native/bbassert.h

+ 7 - 0
modules/monkey/native/bbassert.cpp

@@ -0,0 +1,7 @@
+
+#include "bbassert.h"
+#include "bbdebug.h"
+
+void bbRuntimeError( const bbString &msg ){
+	bbDB::error( msg );
+}

+ 17 - 0
modules/monkey/native/bbassert.h

@@ -0,0 +1,17 @@
+
+#ifndef BBASSERT_H
+#define BBASSERT_H
+
+#include "bbtypes.h"
+
+void bbRuntimeError( const bbString &str );
+
+#define bbAssert( COND,MSG ) (void)((COND) || (bbRuntimeError(MSG),0))
+
+#ifdef NDEBUG
+#define bbDebugAssert( COND,MSG )
+#else
+#define bbDebugAssert( COND,MSG ) (void)((COND) || (bbRuntimeError(MSG),0))
+#endif
+
+#endif