Add a convenience macro invoke subroutines

To properly fail a test in a subroutine, return value needs to be passed up.
This snippet makes it short.

PUBLISHED_FROM=2f6328b5eb2921a4caa53d8887c02f73a5d817ea
This commit is contained in:
Deomid Ryabkov
2018-02-07 14:49:23 +00:00
committed by Cesanta Bot
parent 1ed99999bd
commit cd89db5c2f
+6
View File
@@ -165,6 +165,12 @@ void _strfail(const char *a, const char *e, int len);
} \
} while (0)
#define CHECK_CALL(call) \
do { \
const char *r = (call); \
if (r != NULL) return r; \
} while (0)
#ifndef MG_ENABLE_POLL_UNTIL
#define MG_ENABLE_POLL_UNTIL 0
#endif