繁体   English   中英

在预处理程序指令中结合##和_type

[英]combining ## and _type in preprocessor directives

此代码段中的用法thread##_type的用途是什么? 我知道下划线t (_t)用作命名来标识类型的约定,下划线类型(_type)经常在typedef语句中使用。 我也理解macros ##表示串联。 _type还有其他用途吗? (例如使用双下划线__FILE__ )?

#define THREAD_TYPE(thread)                         
typedef struct                                      \
{                                                   \
   pthread_t pthread;                               \
   int err;                                         \
} thread##_type;

_type在C中没有特殊含义。此代码_type作者选择的方式修饰名称,仅此而已。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM