comparison include/mb_tools.h @ 375:44b8223f307c

Rename MIN/MAX to MB_MIN/MB_MAX. - MIN and MAX are conflicted with system's macros.
author Thinker K.F. Li <thinker@branda.to>
date Wed, 01 Apr 2009 02:16:10 +0800
parents bd8ea44b421e
children c6c0d017dc8e
comparison
equal deleted inserted replaced
374:e1ff44aa3b6f 375:44b8223f307c
136 136
137 #define OFFSET(type, mem) (((void *)&((type *)NULL)->mem) - NULL) 137 #define OFFSET(type, mem) (((void *)&((type *)NULL)->mem) - NULL)
138 #define MEM2OBJ(var, type, mem) ((type *)((void *)var - OFFSET(type, mem))) 138 #define MEM2OBJ(var, type, mem) ((type *)((void *)var - OFFSET(type, mem)))
139 #define OFF2TYPE(obj, off, type) (*(type *)((void *)(obj) + (off))) 139 #define OFF2TYPE(obj, off, type) (*(type *)((void *)(obj) + (off)))
140 140
141 #define MAX(a, b) ((a) > (b)? (a): (b)) 141 #define MB_MAX(a, b) ((a) > (b)? (a): (b))
142 #define MIN(a, b) ((a) < (b)? (a): (b)) 142 #define MB_MIN(a, b) ((a) < (b)? (a): (b))
143 143
144 #endif /* __TOOLS_H_ */ 144 #endif /* __TOOLS_H_ */