diff --git a/lib/std/special/c.zig b/lib/std/special/c.zig index 326ca3a8a0..d0639463a0 100644 --- a/lib/std/special/c.zig +++ b/lib/std/special/c.zig @@ -83,10 +83,6 @@ comptime { @export(log10, .{ .name = "log10", .linkage = .Strong }); @export(log10f, .{ .name = "log10f", .linkage = .Strong }); - @export(ceil, .{ .name = "ceil", .linkage = .Strong }); - @export(ceilf, .{ .name = "ceilf", .linkage = .Strong }); - @export(ceill, .{ .name = "ceill", .linkage = .Strong }); - @export(fmod, .{ .name = "fmod", .linkage = .Strong }); @export(fmodf, .{ .name = "fmodf", .linkage = .Strong }); @@ -429,21 +425,6 @@ fn log10f(a: f32) callconv(.C) f32 { return math.log10(a); } -fn ceilf(x: f32) callconv(.C) f32 { - return math.ceil(x); -} - -fn ceil(x: f64) callconv(.C) f64 { - return math.ceil(x); -} - -fn ceill(x: c_longdouble) callconv(.C) c_longdouble { - if (!long_double_is_f128) { - @panic("TODO implement this"); - } - return math.ceil(x); -} - fn fmodf(x: f32, y: f32) callconv(.C) f32 { return generic_fmod(f32, x, y); } diff --git a/lib/std/special/compiler_rt.zig b/lib/std/special/compiler_rt.zig index 3941918c47..a017266304 100644 --- a/lib/std/special/compiler_rt.zig +++ b/lib/std/special/compiler_rt.zig @@ -680,6 +680,10 @@ comptime { @export(floor, .{ .name = "floor", .linkage = linkage }); @export(floorl, .{ .name = "floorl", .linkage = linkage }); + @export(ceilf, .{ .name = "ceilf", .linkage = linkage }); + @export(ceil, .{ .name = "ceil", .linkage = linkage }); + @export(ceill, .{ .name = "ceill", .linkage = linkage }); + @export(fma, .{ .name = "fma", .linkage = linkage }); @export(fmaf, .{ .name = "fmaf", .linkage = linkage }); @export(fmal, .{ .name = "fmal", .linkage = linkage }); @@ -811,6 +815,19 @@ fn floorl(x: c_longdouble) callconv(.C) c_longdouble { return math.floor(x); } +fn ceilf(x: f32) callconv(.C) f32 { + return math.ceil(x); +} +fn ceil(x: f64) callconv(.C) f64 { + return math.ceil(x); +} +fn ceill(x: c_longdouble) callconv(.C) c_longdouble { + if (!long_double_is_f128) { + @panic("TODO implement this"); + } + return math.ceil(x); +} + // Avoid dragging in the runtime safety mechanisms into this .o file, // unless we're trying to test this file. pub fn panic(msg: []const u8, error_return_trace: ?*std.builtin.StackTrace) noreturn {