在BSD系统的头文件queue.h中,有以下宏
#define TAILQ_ENTRY(type, qual)\
struct {\
qual type *tqe_next; /* next element */\
qual type *qual *tqe_prev; /* address of previous next element */\
}
Run Code Online (Sandbox Code Playgroud)
根据上面的定义,人们应该使用它
struct foo {
TAILQ_ENTRY(struct foo, ) my_list;
//some data here
};
Run Code Online (Sandbox Code Playgroud)
我的问题是:这里的宏参数"qual"的目的是什么,似乎在代码生成中没有任何作用.
好吧,在您的使用中,也许它没有使用,但可以像一个电话一样打电话
struct foo {
TAILQ_ENTRY(struct foo, ) my_list;
TAILQ_ENTRY(struct foo, const) my_list_too;
//some data here
};
Run Code Online (Sandbox Code Playgroud)
consttype-qualifier 在哪里?
类型限定符可以是的const,restrict,volatile或_Atomic.
| 归档时间: |
|
| 查看次数: |
93 次 |
| 最近记录: |