我有以下代码,当我尝试编译它时,出现错误:
错误:“list_item_t”没有名为“state”的成员</p>
有什么创意可以让这段代码在没有警告和错误的情况下编译吗?
#if defined (_DEBUG_)
#define ASSERT assert
#else /* _DEBUG_ */
#define ASSERT( exp ) ((void)(exp))
#endif`
typedef struct list_item {
struct list_item *p_next;
struct list_item *p_prev;
#ifdef _DEBUG_
int state;
#endif
} list_item_t;
main(int argc, char *argv)
{
list_item_t p_list_item;
ASSERT(p_list_item.state == 0);
}