zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit a94267b2906e90aadf397b3f524e1069721fb496 (tree)
parent 1bbb886694b96fdfbba0857dcba56a1ec5c8fbd4
Author: Jakub Konka <kubkon@jakubkonka.com>
Date:   Tue, 22 Feb 2022 14:02:23 +0100

std: export ceil builtins in stage2

Diffstat:
Mlib/std/special/c.zig | 19+++++++++++++++++++
Mlib/std/special/c_stage1.zig | 13-------------
2 files changed, 19 insertions(+), 13 deletions(-)

diff --git a/lib/std/special/c.zig b/lib/std/special/c.zig @@ -46,6 +46,10 @@ 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 }); } // Avoid dragging in the runtime safety mechanisms into this .o file, @@ -179,3 +183,18 @@ fn log10(a: f64) callconv(.C) f64 { 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); +} diff --git a/lib/std/special/c_stage1.zig b/lib/std/special/c_stage1.zig @@ -613,19 +613,6 @@ export fn fmod(x: f64, y: f64) f64 { return generic_fmod(f64, x, y); } -export fn ceilf(x: f32) f32 { - return math.ceil(x); -} -export fn ceil(x: f64) f64 { - return math.ceil(x); -} -export fn ceill(x: c_longdouble) c_longdouble { - if (!long_double_is_f128) { - @panic("TODO implement this"); - } - return math.ceil(x); -} - export fn fmaf(a: f32, b: f32, c: f32) f32 { return math.fma(f32, a, b, c); }