金刚豆

关注

宏定义时动态定义结构体

金刚豆

关注

阅读 68

2022-09-19


struct packet {
char type;
};

#define TAILQ_HEAD(name, type)            \
struct name { \
struct type *tqh_first; /* first element */ \
struct type **tqh_last; /* addr of last next element */ \
}

void test()
{
TAILQ_HEAD(, packet) outgoing; //结构体的标签为NULL
TAILQ_HEAD(xxx, packet) outgoing1; //结构体的标签为xxx
}

 

 

 

相关推荐

_鱼与渔_

#define 定义常量和宏,指针和结构体

_鱼与渔_ 154 0 0

janedaring

宏定义之-求结构体成员的偏移长度

janedaring 89 0 0

悬灸人雪洋

GoLang 结构体定义

悬灸人雪洋 115 0 0

数数扁桃

宏定义

数数扁桃 98 0 0

color_小浣熊

C语言--结构体定义

color_小浣熊 12 0 0

芷兮离离

java语言定义结构体

芷兮离离 41 0 0

_鱼与渔_

结构体01:结构体的定义和使用

_鱼与渔_ 74 0 0

左小米z

如何在内核里面查找某些结构体或者宏的定义

左小米z 83 0 0

小北的爹

Python中定义(声明)结构体

小北的爹 55 0 0

不会弹吉他的二郎腿

struct结构体类型的定义

不会弹吉他的二郎腿 146 0 0

精彩评论(0)

0 0 举报