X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=minmax.h;h=afc78f02e4b3f4cfe2de624d780301a54f8bc926;hp=97957c8874e2e68b6e84a318d70c7c62670501bf;hb=b9c153b9023c3de65f01aeac4d1e993986a7107e;hpb=f747ad2c5352b977007997b454333be37de7f4c9 diff --git a/minmax.h b/minmax.h index 97957c88..afc78f02 100644 --- a/minmax.h +++ b/minmax.h @@ -17,4 +17,9 @@ _x > _y ? _x : _y; }) #endif +#define min_not_zero(x, y) ({ \ + typeof(x) __x = (x); \ + typeof(y) __y = (y); \ + __x == 0 ? __y : ((__y == 0) ? __x : min(__x, __y)); }) + #endif