X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/ccd33bdc275e7b4b7cc18d484ec68976354e48e2..47f55bc70a0eef068c8a27ca0618a11c512dbf20:/Exception.hpp diff --git a/Exception.hpp b/Exception.hpp index 73287dd..d683369 100644 --- a/Exception.hpp +++ b/Exception.hpp @@ -70,6 +70,11 @@ while (false) #define _assert(test) \ _assert_("assert", (test), #test, "") +#define _require(expr) ({ \ + __typeof__(expr) _value = (expr); \ + _assert_("require", _value != NULL, #expr, ""); \ +_value; }) + #define _trace() do { \ fprintf(stderr, "_trace():%u\n", __LINE__); \ } while (false)