C/C++宏定义中#与##区别 .

// #表示:对应变量字符串化
// ##表示:把宏参数名与宏定义代码序列中的标识符连接在一起,形成一个新的标识符

 

#define U_BOOT_CMD_MKENT_COMPLETE(name,maxargs,rep,cmd,usage,help,comp) \
 {#name, maxargs, rep, cmd, usage, _CMD_HELP(help) _CMD_COMPLETE(comp)}

 

#define U_BOOT_CMD_COMPLETE(name,maxargs,rep,cmd,usage,help,comp) \
 cmd_tbl_t __u_boot_cmd_##name Struct_Section = \
  U_BOOT_CMD_MKENT_COMPLETE(name,maxargs,rep,cmd,usage,help,comp)

 

posted on 2016-07-11 11:01  黑大米  阅读(158)  评论(0编辑  收藏  举报

导航