Export zig builtin version of __muloti4 as weak so it doesn't conflict if it already exists

This commit is contained in:
Brendan Hansknecht 2021-09-24 08:54:41 -07:00
parent 95f29c4d5b
commit c334e4d3e5

View file

@ -164,7 +164,12 @@ test "" {
// https://github.com/ziglang/zig/blob/85755c51d529e7d9b406c6bdf69ce0a0f33f3353/lib/std/special/compiler_rt/muloti4.zig
//
// Thank you Zig Contributors!
export fn __muloti4(a: i128, b: i128, overflow: *c_int) callconv(.C) i128 {
// Export it as weak incase it is alreadly linked in by something else.
comptime {
@export(__muloti4, .{ .name = "__muloti4", .linkage = .Weak });
}
fn __muloti4(a: i128, b: i128, overflow: *c_int) callconv(.C) i128 {
// @setRuntimeSafety(std.builtin.is_test);
const min = @bitCast(i128, @as(u128, 1 << (128 - 1)));