X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=fifo.h;h=749136530a2c5410867f10caf672c155949daa2f;hp=8e34fb61f3675fa250696e5bf92348dfe531b2bc;hb=271067a6e278dafd62649257fe99ce536acfe7bb;hpb=104bc4bdf55bd79c2b3f9087601c3df4aa884b2a diff --git a/fifo.h b/fifo.h index 8e34fb61..74913653 100644 --- a/fifo.h +++ b/fifo.h @@ -40,15 +40,19 @@ static inline unsigned int fifo_room(struct fifo *fifo) return fifo->size - fifo->in + fifo->out; } +#ifndef min #define min(x,y) ({ \ typeof(x) _x = (x); \ typeof(y) _y = (y); \ (void) (&_x == &_y); \ _x < _y ? _x : _y; }) +#endif +#ifndef max #define max(x,y) ({ \ typeof(x) _x = (x); \ typeof(y) _y = (y); \ (void) (&_x == &_y); \ _x > _y ? _x : _y; }) +#endif