Add "do ... while(0)" around CHECK_ETC test macros

This commit is contained in:
Nigel Tao committed 2020-01-08 13:59:50 +11:00
1 parent 4323a16707
commit eeae6098b6
1 file changed
+4 -4
+4 -4
View File
@@ -66,20 +66,20 @@ char fail_msg[65536] = {0};
msg += snprintf(msg, sizeof(fail_msg) - (msg - fail_msg), ##__VA_ARGS__)
#define CHECK_STATUS(prefix, status) \
{ \
do { \
wuffs_base__status z = status; \
if (z.repr) { \
RETURN_FAIL("%s: \"%s\"", prefix, z.repr); \
} \
}
} while (0)
#define CHECK_STRING(string) \
{ \
do { \
const char* z = string; \
if (z) { \
return z; \
} \
}
} while (0)
int tests_run = 0;