mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-23 11:44:53 +00:00
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:
1 parent
1ed99999bd
commit
cd89db5c2f
1 file changed
+6
@@ -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
|
||||
|
||||
Reference in new issue
Block a user