Can you match any compound type with _Generic in C?

后端 未结 0 930
醉酒成梦
醉酒成梦 2020-12-30 23:54

I would like to detect if the macro call is done on a struct type. A naive approach didn\'t work:

#define IS_STRUCT(x) _Generic((x), struct *: 1, default: 0);         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题