Linux kernel min/max宏

#define min(x,y) ({   \
 typeof(x) _x = (x);  \
 typeof(y) _y = (y);  \
 (void) (&_x == &_y); \
 _x < _y ? _x : _y; })
 
#define max(x,y) ({   \
 typeof(x) _x = (x);  \
 typeof(y) _y = (y);  \
 (void) (&_x == &_y); \
 _x > _y ? _x : _y; })
posted @ 2019-11-12 13:57  sfdevs  阅读(210)  评论(0)    收藏  举报