Merge remote-tracking branch 'origin/trunk' into divTruncate

This commit is contained in:
Folkert 2021-10-19 23:36:03 +02:00
commit bd98ac6dc7
33 changed files with 2455 additions and 1155 deletions

View file

@ -83,6 +83,7 @@ const FLOATS = [_]type{ f32, f64 };
const NUMBERS = INTEGERS ++ FLOATS;
comptime {
exportNumFn(num.divCeil, "div_ceil");
exportNumFn(num.bytesToU16C, "bytes_to_u16");
exportNumFn(num.bytesToU32C, "bytes_to_u32");

View file

@ -57,6 +57,10 @@ pub fn exportRound(comptime T: type, comptime name: []const u8) void {
@export(f, .{ .name = name ++ @typeName(T), .linkage = .Strong });
}
pub fn divCeil(numerator: i64, denominator: i64) callconv(.C) i64 {
return @call(.{ .modifier = always_inline }, math.divCeil, .{ i64, numerator, denominator }) catch unreachable;
}
pub fn bytesToU16C(arg: RocList, position: usize) callconv(.C) u16 {
return @call(.{ .modifier = always_inline }, bytesToU16, .{ arg, position });
}