wasm: implement addOrPanic in Zig

This commit is contained in:
Brian Carroll 2022-06-21 21:23:29 +01:00
parent 795afc0cf6
commit d7ac8cfcbc
No known key found for this signature in database
GPG key ID: 9CF4E3BF9C4722C7
4 changed files with 36 additions and 6 deletions

View file

@ -21,6 +21,7 @@ comptime {
exportDecFn(dec.subC, "sub_with_overflow");
exportDecFn(dec.mulC, "mul_with_overflow");
exportDecFn(dec.divC, "div");
exportDecFn(dec.addOrPanicC, "add_or_panic");
}
// List Module
@ -104,6 +105,7 @@ comptime {
num.exportRoundF64(T, ROC_BUILTINS ++ "." ++ NUM ++ ".round_f64.");
num.exportAddWithOverflow(T, ROC_BUILTINS ++ "." ++ NUM ++ ".add_with_overflow.");
num.exportAddOrPanic(T, ROC_BUILTINS ++ "." ++ NUM ++ ".add_or_panic.");
const Wider = WIDEINTS[i];
num.exportAddSaturatedInt(T, Wider, ROC_BUILTINS ++ "." ++ NUM ++ ".add_saturated.");
}