-
Notifications
You must be signed in to change notification settings - Fork 0
/
globalDefs.h
54 lines (47 loc) · 1.15 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
46
47
48
49
50
51
52
53
/*
* File: global_def.h
* Authors: Danni Friedland & Yaniv Dudu
*
* Created on April 9, 2010, 6:20 PM
*/
#ifndef _GLOBALDEFS_H
#define _GLOBALDEFS_H
#include <unistd.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
typedef int tID;
typedef enum op_status {
OP_SUCCESS=1,
OP_FAIL=-1,
OP_DONE=2
} op_status;
typedef char boolean;
#define false 0
#define true (!false)
typedef char* string;
/* thread stack size */
#define MAX_STACK_SIZE 0x4000
#define MAX_INPUT_LENGTH 50
#define MIN_PRIORITY 0
#define NULL ((void *)0)
#define NULL_TID -1
#define NULL_THREAD 0
#define OUT
#define IN
//#define DEBUG
//DEBUGGING
# define __ASSERT_VOID_CAST (void)
#ifdef DEBUG
#define ASSERT(expr) \
((expr) \
? __ASSERT_VOID_CAST (0) \
: exit(printf("=========assertion failed on line:%d\t file:%s\n",__LINE__,__FILE__)))
#define ASSERT_RUN(expr) (expr)
#define ASSERT_PRINT(expr...) (printf(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 */