使用宏拼接函数名
2017-12-16 本文已影响0人
冰红茶绿茶
TH_CONCAT_4宏的作用
#include <stdio.h>
#define Real Int
#define TH_CONCAT_4_EXPAND(x,y,z,w) x ## y ## z ## w
#define TH_CONCAT_4(x,y,z,w) TH_CONCAT_4_EXPAND(x,y,z,w)
#define THStorage_(NAME) TH_CONCAT_4(TH,Real,Storage_,NAME)
void THStorage_(newWithSize)(){
printf ("%s\n", __func__);
}
int main(void)
{
printf ("%s\n", __func__);
THStorage_(newWithSize)();
return 0;
}