diff options
Diffstat (limited to 'tools/js2c_macros/check_macros.py')
-rw-r--r-- | tools/js2c_macros/check_macros.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/js2c_macros/check_macros.py b/tools/js2c_macros/check_macros.py new file mode 100644 index 0000000000..f24d47c9ee --- /dev/null +++ b/tools/js2c_macros/check_macros.py @@ -0,0 +1,8 @@ +# flake8: noqa +macro CHECK(x) = do { if (!(x)) (process._rawDebug("CHECK: x == true"), process.abort()) } while (0); +macro CHECK_EQ(a, b) = CHECK((a) === (b)); +macro CHECK_GE(a, b) = CHECK((a) >= (b)); +macro CHECK_GT(a, b) = CHECK((a) > (b)); +macro CHECK_LE(a, b) = CHECK((a) <= (b)); +macro CHECK_LT(a, b) = CHECK((a) < (b)); +macro CHECK_NE(a, b) = CHECK((a) !== (b)); |