LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1321|回复: 1

[请教]struct net_device中的define语句作用

[复制链接]
发表于 2008-3-31 15:31:02 | 显示全部楼层 |阅读模式
看不懂net_device中的define语句。
例如
[php]
struct net_device

int ...;
#define NETIF_F_SG                1        /* Scatter/gather IO. */
.......
}
[/php]
为什么要将define语句放在结构体里面
还有
[php]
struct net_device
{
……
#define HAVE_MULTICAST                         
        void                        (*set_multicast_list)(struct net_device *dev);
……
}
[/php]
这句话里的define怎么看都像是注释,是否真的如此呢?
 楼主| 发表于 2008-4-2 05:28:55 | 显示全部楼层
第一个搞明白了,给结构内的函数指针列出了参数。
第二个问题,就当成是注释作用了。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表