Whamcloud - gitweb
61aca3f438bd234b9741b6b0606b16148dd51467
[fs/lustre-release.git] / lnet / include / lnet / defines.h
1 #include "build_check.h"
2 /*
3 **
4 ** This files contains definitions that are used throughout the cplant code.
5 */
6
7 #ifndef CPLANT_H
8 #define CPLANT_H
9
10 #define TITLE(fname,zmig)
11
12
13 /*
14 ** TRUE and FALSE
15 */
16 #undef TRUE
17 #define TRUE            (1)
18 #undef FALSE
19 #define FALSE           (0)
20
21
22 /*
23 ** Return codes from functions
24 */
25 #undef OK
26 #define OK              (0)
27 #undef ERROR
28 #define ERROR           (-1)
29
30
31
32 /*
33 ** The GCC macro for a safe max() that works on all types arithmetic types.
34 */
35 #ifndef MAX
36 #define MAX(a, b)       (a) > (b) ? (a) : (b)
37 #endif /* MAX */
38
39 #ifndef MIN
40 #define MIN(a, b)       (a) < (b) ? (a) : (b)
41 #endif /* MIN */
42
43 /*
44 ** The rest is from the old qkdefs.h
45 */
46
47 #ifndef __linux__
48 #define __inline__
49 #endif
50
51 #ifndef NULL
52 #define NULL ((void *)0)
53 #endif
54
55 #ifndef __osf__
56 #define PRIVATE static
57 #define PUBLIC
58 #endif
59
60 #ifndef __osf__
61 typedef unsigned char           uchar;
62 #endif
63
64 typedef char                    CHAR;
65 typedef unsigned char           UCHAR;
66 typedef char                    INT8;
67 typedef unsigned char           UINT8;
68 typedef short int               INT16;
69 typedef unsigned short int      UINT16;
70 typedef int                     INT32;
71 typedef unsigned int            UINT32;
72 typedef long                    LONG32;
73 typedef unsigned long           ULONG32;
74
75 /* long may be 32 or 64, so we can't really append the size to the definition */
76 typedef long                    LONG;
77 typedef unsigned long           ULONG;
78
79 #ifdef __alpha__
80 typedef long int_t;
81 #ifndef __osf__
82 typedef unsigned long uint_t;
83 #endif
84 #endif
85
86 #ifdef __i386__
87 typedef int int_t;
88 typedef unsigned int uint_t;
89 #endif
90
91 typedef float                   FLOAT32;
92 typedef double                  FLOAT64;
93 typedef void                    VOID;
94 typedef INT32                   BOOLEAN;
95 typedef void (*FCN_PTR)(void);
96
97 #ifndef off64_t
98
99 #if defined (__alpha__) || defined (__ia64__)
100 typedef long                     off64_t;
101 #else
102 typedef long long                off64_t;
103 #endif
104
105 #endif
106
107 /*
108 ** Process related typedefs
109 */
110 typedef UINT16 PID_TYPE;  /* Type of Local process ID */
111 typedef UINT16 NID_TYPE;  /* Type of Physical node ID */
112 typedef UINT16 GID_TYPE;  /* Type of Group ID */
113 typedef UINT16 RANK_TYPE; /* Type of Logical rank/process within a group */
114
115
116
117 #endif /* CPLANT_H */