This commit is contained in:
Nikita Ivanov 2022-06-12 15:24:42 +05:00
parent c3ad27a830
commit 852f8af0a3
No known key found for this signature in database
GPG Key ID: 6E656AC5B97B5133

View File

@ -6,13 +6,12 @@
#define CHECK(f, cond) \
do { \
int x = (f); \
if (cond) \
if (!(cond)) \
return x; \
} while (0)
#define CHECK_OK(f) CHECK(f, x != STAT_OK)
#define CHECK_NULL(f) CHECK(f, x != STAT_NULL)
#define CHECK_OK_NULL(f) CHECK(f, x != STAT_OK || x != STAT_NULL)
#define CHECK_OK(f) CHECK(f, x == STAT_OK)
#define CHECK_NULL(f) CHECK(f, x == STAT_NULL)
#define EXPECT(x) CHECK_OK(expect(x))
#define ACCEPT(x) CHECK_OK(accept(x))