Commit a94267b290

Jakub Konka <kubkon@jakubkonka.com>
2022-02-22 14:02:23
std: export ceil builtins in stage2
1 parent 1bbb886
Changed files (2)
lib
std
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);
+}
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);
 }