mirror of
https://github.com/cesanta/mongoose.git
synced 2025-08-06 13:37:34 +08: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:
parent
1ed99999bd
commit
cd89db5c2f
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user