瀏覽代碼

Added null object function test.

woollybah 8 年之前
父節點
當前提交
c7b6a26f7f
共有 2 個文件被更改,包括 8 次插入0 次删除
  1. 6 0
      blitz.mod/blitz_object.c
  2. 2 0
      blitz.mod/blitz_object.h

+ 6 - 0
blitz.mod/blitz_object.c

@@ -227,3 +227,9 @@ BBDebugScope * bbObjectStructInfo( char * name ) {
 	
 	return 0;
 }
+
+BBObject * bbNullObjectTest( BBObject *o ) {
+	if (o == &bbNullObject) brl_blitz_NullObjectError();
+	return o;
+}
+

+ 2 - 0
blitz.mod/blitz_object.h

@@ -93,6 +93,8 @@ struct struct_node {
 void bbObjectRegisterStruct( BBDebugScope *p );
 BBDebugScope * bbObjectStructInfo( char * name );
 
+BBObject * bbNullObjectTest( BBObject *o );
+
 #ifdef __cplusplus
 }
 #endif