by Spiritus · 8y ago · 0 comments
#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?
The wile...while(0) statement is new for me (didn't know this is actually legal syntax), but I suspect it's done for similar reasons.
It looks like some unusual looping syntax; but in fact these are just two normal while loops one after another.