Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
at v2.6.22 23 lines 460 B view raw
1#ifndef _TYPES_H_ 2#define _TYPES_H_ 3 4#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) 5 6typedef unsigned char u8; 7typedef unsigned short u16; 8typedef unsigned int u32; 9typedef unsigned long long u64; 10 11#define min(x,y) ({ \ 12 typeof(x) _x = (x); \ 13 typeof(y) _y = (y); \ 14 (void) (&_x == &_y); \ 15 _x < _y ? _x : _y; }) 16 17#define max(x,y) ({ \ 18 typeof(x) _x = (x); \ 19 typeof(y) _y = (y); \ 20 (void) (&_x == &_y); \ 21 _x > _y ? _x : _y; }) 22 23#endif /* _TYPES_H_ */