forked from openbmc/libmctp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrange.h
26 lines (22 loc) · 851 Bytes
/
range.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
#ifndef _RANGE_H
#define _RANGE_H
#ifndef typeof
#define typeof __typeof__
#endif
#ifndef MIN
#define MIN(a, b) \
({ \
typeof(a) _a = a; \
typeof(b) _b = b; \
_a < _b ? _a : _b; \
})
#endif
#ifndef MAX
#define MAX(a, b) \
({ \
typeof(a) _a = a; \
typeof(b) _b = b; \
_a > _b ? _a : _b; \
})
#endif
#endif