Skip to content

Commit 62d11f0

Browse files
committed
add compiler_rt ceilf/ceil/ceill
this should fix stage1 build error with msvc 2019
1 parent 911c839 commit 62d11f0

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

lib/std/special/compiler_rt.zig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,10 @@ comptime {
680680
@export(floor, .{ .name = "floor", .linkage = linkage });
681681
@export(floorl, .{ .name = "floorl", .linkage = linkage });
682682

683+
@export(ceilf, .{ .name = "ceilf", .linkage = linkage });
684+
@export(ceil, .{ .name = "ceil", .linkage = linkage });
685+
@export(ceill, .{ .name = "ceill", .linkage = linkage });
686+
683687
@export(fma, .{ .name = "fma", .linkage = linkage });
684688
@export(fmaf, .{ .name = "fmaf", .linkage = linkage });
685689
@export(fmal, .{ .name = "fmal", .linkage = linkage });
@@ -811,6 +815,19 @@ fn floorl(x: c_longdouble) callconv(.C) c_longdouble {
811815
return math.floor(x);
812816
}
813817

818+
fn ceilf(x: f32) callconv(.C) f32 {
819+
return math.ceil(x);
820+
}
821+
fn ceil(x: f64) callconv(.C) f64 {
822+
return math.ceil(x);
823+
}
824+
fn ceill(x: c_longdouble) callconv(.C) c_longdouble {
825+
if (!long_double_is_f128) {
826+
@panic("TODO implement this");
827+
}
828+
return math.ceil(x);
829+
}
830+
814831
// Avoid dragging in the runtime safety mechanisms into this .o file,
815832
// unless we're trying to test this file.
816833
pub fn panic(msg: []const u8, error_return_trace: ?*std.builtin.StackTrace) noreturn {

0 commit comments

Comments
 (0)