|
|
|
|
|
by Spiritus
2848 days ago
|
|
What's the deal with the `while ... while(0)` and `do ... while(0)` macros? Is it some scoping trick? #define TKVDB_EXEC(FUNC) \
do { \
TKVDB_RES r = FUNC; \
if (r != TKVDB_OK) { \
return r; \
} \
} while (0)
#define TKVDB_SKIP_RNODES(NODE) \
while (NODE->c.replaced_by) { \
NODE = NODE->c.replaced_by; \
} while (0)
|
|
http://c-faq.com/cpp/multistmt.html
while … while(0) looks like a mistake?