标签:
1:我们常常会看到诸如此类的头文件的书写方式:
#ifdef MY_HEAD_H__ #define MY_HEAD_H__ #endif
#ifdef __GNUC__ /* This macro stops ‘gcc -Wall‘ complaining that "control reaches end of non-void function" if we use the following functions to terminate main() or some other non-void function. */ #define NORETURN __attribute__ ((__noreturn__)) #else #define NORETURN #endif
/*完成两个x和y的拼接*/ #define Conn(x,y) x##y /*跟x加上单引号变字符,x长度不能超过四,可能是因为单字符转译时最多为4位*/ #define ToChar(x) #@x /*给x加上双引号,变成字符串*/ #define ToString(x) #x /*定义宏函数,换行时需要用\进行拼接*/ #define functionA(args){ //函数体 \ }
http://blog.chinaunix.net/uid-22566367-id-381995.html
http://www.cnblogs.com/gaojian/p/3167451.html
http://blog.csdn.net/zhangxinrun/article/details/5808788
http://www.cnblogs.com/flywuya/archive/2010/12/04/1896121.html
标签:
原文地址:http://www.cnblogs.com/gtooo1/p/5263924.html