X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=minmax.h;h=ec0848c0d67c7f84c549868e60f5063150a0cdeb;hp=afc78f02e4b3f4cfe2de624d780301a54f8bc926;hb=1ef098712b688f81d014b2975fda5a278e582ca6;hpb=4b157ac6446364e5eecdcdbf75fc1a814489a343 diff --git a/minmax.h b/minmax.h index afc78f02..ec0848c0 100644 --- a/minmax.h +++ b/minmax.h @@ -3,23 +3,23 @@ #ifndef min #define min(x,y) ({ \ - typeof(x) _x = (x); \ - typeof(y) _y = (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); \ + __typeof__(x) _x = (x); \ + __typeof__(y) _y = (y); \ (void) (&_x == &_y); \ _x > _y ? _x : _y; }) #endif #define min_not_zero(x, y) ({ \ - typeof(x) __x = (x); \ - typeof(y) __y = (y); \ + __typeof__(x) __x = (x); \ + __typeof__(y) __y = (y); \ __x == 0 ? __y : ((__y == 0) ? __x : min(__x, __y)); }) #endif