百度空间 | 百度首页 
 
查看文章
 
type.h
2009-09-30 10:36
#ifndef _TYPES_H_
#define _TYPES_H_

#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))

typedef unsigned char        u8;
typedef unsigned short        u16;
typedef unsigned int        u32;
typedef unsigned long long    u64;
typedef signed char        s8;
typedef short            s16;
typedef int            s32;
typedef long long        s64;

#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; })

#endif /* _TYPES_H_ */

类别:c语言实践 | 添加到搜藏 | 浏览() | 评论 (0)
 
最近读者:
 
网友评论:
发表评论:
姓 名:
网址或邮箱: (选填)
内 容:
验证码: 请点击后输入四位验证码,字母不区分大小写
      

     

©2009 Baidu