mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-19 19:40:56 +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)
|
} while (0)
|
||||||
|
|
||||||
|
#define CHECK_CALL(call) \
|
||||||
|
do { \
|
||||||
|
const char *r = (call); \
|
||||||
|
if (r != NULL) return r; \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
#ifndef MG_ENABLE_POLL_UNTIL
|
#ifndef MG_ENABLE_POLL_UNTIL
|
||||||
#define MG_ENABLE_POLL_UNTIL 0
|
#define MG_ENABLE_POLL_UNTIL 0
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in new issue
Block a user