[英]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.