macro defination宏定义

来源:互联网 发布:docker 映射端口号 编辑:程序博客网 时间:2024/05/17 08:48

if complicated express needs defined in macro defination.
use do while(0) is good for it.

#define PACK_DATA(value, play) \
          do {  \
            play->data = value; \
            play->length = strlen(value); \
          } while(0)

原创粉丝点击