/
globaldefs.h
46 lines (36 loc) · 1.09 KB
/
globaldefs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* File: GlobalDefs.h
* Author: danni & yaniv
*
* Created on May 9, 2010, 5:58 PM
*/
#ifndef _GLOBALDEFS_H
#define _GLOBALDEFS_H
typedef unsigned char bool;
typedef char* string;
#define NULL ((void *)0)
#define OUT
#define IN
#define FALSE 0
#define TRUE (!FALSE)
//=========================Debugging functions===============================
//#define DEBUG
//DEBUGGING
#define __ASSERT_VOID_CAST (void)
#define ASSERT_ALWAYS(expr) \
((expr) \
? __ASSERT_VOID_CAST (0) \
: exit(fprintf(outFile,"=========assertion failed on line:%d\t file:%s\n",__LINE__,__FILE__)))
#ifdef DEBUG
#define ASSERT(expr) \
((expr) \
? __ASSERT_VOID_CAST (0) \
: exit(fprintf(outFile,"=========assertion failed on line:%d\t file:%s\n",__LINE__,__FILE__)))
#define ASSERT_RUN(expr) (expr)
#define ASSERT_PRINT(expr...) (fprintf(outFile,expr))
#else
#define ASSERT(expr) __ASSERT_VOID_CAST (0)
#define ASSERT_RUN(expr) __ASSERT_VOID_CAST (0)
#define ASSERT_PRINT(expr...) __ASSERT_VOID_CAST (0)
#endif
#endif /* _GLOBALDEFS_H */