Commit ee2409ec authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

compiler: Grab min_t, max_t from the kernel

Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 23a2472c
......@@ -66,6 +66,16 @@
(void) (&_max1 == &_max2); \
_max1 > _max2 ? _max1 : _max2; })
#define min_t(type, x, y) ({ \
type __min1 = (x); \
type __min2 = (y); \
__min1 < __min2 ? __min1: __min2; })
#define max_t(type, x, y) ({ \
type __max1 = (x); \
type __max2 = (y); \
__max1 > __max2 ? __max1: __max2; })
#define is_log2(v) (((v) & ((v) - 1)) == 0)
#endif /* __CR_COMPILER_H__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment