gpt4 book ai didi

c - 为什么我总是看到多行宏包裹在(看似)毫无意义的循环中?

转载 作者:太空狗 更新时间:2023-10-29 15:24:53 26 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
how does do{} while(0) work in macro?

示例来自 this博文:

#define VTAILQ_INSERT_BEFORE(listelm, elm, field) do {              \
(elm)->field.vtqe_prev = (listelm)->field.vtqe_prev; \
VTAILQ_NEXT((elm), field) = (listelm); \
*(listelm)->field.vtqe_prev = (elm); \
(listelm)->field.vtqe_prev = &VTAILQ_NEXT((elm), field); \
} while (0)

我遇到过其他人,但是这个很好地强调了我的意思

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com