#define 用法

来源:互联网 发布:科比 知乎 编辑:程序博客网 时间:2024/05/16 18:45
#define A(x) T_##x
#define B(x) #@x
#define C(x) #x


我们假设:x=1,则有:


A(1)------〉T_1
B(1)------〉'1'

C(1)------〉"1"


#define DIRECT_INTERFACE_IMPLEMENTATION(type, impl) \
__attribute__((constructor)) \
void \
type##_##impl##_ctor(void) \


如果 DIRECT_INTERFACE_IMPLEMENTATION(IDirectFBFont,FT2)
就变成了
void IDirectFBFont_FT2_ctor()




参见
http://blog.csdn.net/benny5609/archive/2008/04/22/2314541.aspx

原创粉丝点击