宏不编译

时间:2015-12-18 22:04:14

标签: c macros

为什么这段代码不能编译?

#define container_of(ptr, type, field_name) ( \
(type *) ((char *) (ptr) - offsetof(type, field_name)))

错误

  

C:\ list.h:37:错误:')之前的预期表达式令牌(类型*)((char *)(ptr) - offsetof(type,field_name)))^

0 个答案:

没有答案
相关问题