10 Star 15 Fork 5

anolis / fio

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
minmax.h 489 Bytes
一键复制 编辑 原始数据 按行查看 历史
tchaikov_cc7c 提交于 2018-07-25 22:02 . replace typeof with typeof
#ifndef FIO_MIN_MAX_H
#define FIO_MIN_MAX_H
#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
#define min_not_zero(x, y) ({ \
__typeof__(x) __x = (x); \
__typeof__(y) __y = (y); \
__x == 0 ? __y : ((__y == 0) ? __x : min(__x, __y)); })
#endif
1
https://gitee.com/anolis/fio.git
git@gitee.com:anolis/fio.git
anolis
fio
fio
an8

搜索帮助