这个宏VPORT是什么意思#define VPORT(member,conftype,initvalue) \VAR(#member,conftype,member ## _lines,initvalue)/*XXXX these next two are duplicates or near-duplicates from config.c */#define VAR(name,conftype,member,initvalue) \{ name,CONFIG_
来源:学生作业帮助网 编辑:作业帮 时间:2024/08/26 16:17:40
![这个宏VPORT是什么意思#define VPORT(member,conftype,initvalue) \VAR(#member,conftype,member ## _lines,initvalue)/*XXXX these next two are duplicates or near-duplicates from config.c */#define VAR(name,conftype,member,initvalue) \{ name,CONFIG_](/uploads/image/z/11650067-35-7.jpg?t=%E8%BF%99%E4%B8%AA%E5%AE%8FVPORT%E6%98%AF%E4%BB%80%E4%B9%88%E6%84%8F%E6%80%9D%23define+VPORT%28member%2Cconftype%2Cinitvalue%29+%5CVAR%28%23member%2Cconftype%2Cmember+%23%23+_lines%2Cinitvalue%29%2F%2AXXXX+these+next+two+are+duplicates+or+near-duplicates+from+config.c+%2A%2F%23define+VAR%28name%2Cconftype%2Cmember%2Cinitvalue%29+%5C%7B+name%2CCONFIG_)
这个宏VPORT是什么意思#define VPORT(member,conftype,initvalue) \VAR(#member,conftype,member ## _lines,initvalue)/*XXXX these next two are duplicates or near-duplicates from config.c */#define VAR(name,conftype,member,initvalue) \{ name,CONFIG_
这个宏VPORT是什么意思
#define VPORT(member,conftype,initvalue) \
VAR(#member,conftype,member ## _lines,initvalue)
/*XXXX these next two are duplicates or near-duplicates from config.c */
#define VAR(name,conftype,member,initvalue) \
{ name,CONFIG_TYPE_ ## conftype,STRUCT_OFFSET(or_state_t,member),\
initvalue }
#define STRUCT_OFFSET(tp,member) \
((off_t) (((char*)&((tp*)0)->member)-(char*)0))
/* Non-ANSI name for compatibility */
typedef long off_t;
我已经被绕晕了
这个宏VPORT是什么意思#define VPORT(member,conftype,initvalue) \VAR(#member,conftype,member ## _lines,initvalue)/*XXXX these next two are duplicates or near-duplicates from config.c */#define VAR(name,conftype,member,initvalue) \{ name,CONFIG_
宏不难理解啊,VPORT和VAR作用是一样的,都是生成一个条目,这个条目的字段分别是:
{ 字段名称,一个对应的CONFIG_TYPE ,字段在结构体 or_state_t 中的偏移位置,initvalue }
至于这个条目的作用或者意义,那就要看具体是怎么使用的了.