Merge branch 'req6' of git://github.com/kusumi/fio
[fio.git] / minmax.h
CommitLineData
5ffb051d
JA
1#ifndef FIO_MIN_MAX_H
2#define FIO_MIN_MAX_H
3
4#ifndef min
f747ad2c
JA
5#define min(x,y) ({ \
6 typeof(x) _x = (x); \
7 typeof(y) _y = (y); \
8 (void) (&_x == &_y); \
9 _x < _y ? _x : _y; })
5ffb051d 10#endif
f747ad2c 11
5ffb051d 12#ifndef max
f747ad2c
JA
13#define max(x,y) ({ \
14 typeof(x) _x = (x); \
15 typeof(y) _y = (y); \
16 (void) (&_x == &_y); \
17 _x > _y ? _x : _y; })
5ffb051d
JA
18#endif
19
20#endif