| author | |
| committer | |
| log | 2cbd6980e5a06ce4a2828a10b6cdb0efba827f84 |
| tree | 929d229b69c5b86bf9c31f0c96ac506d3928988c |
| parent | db1e649575a741527ca0fd7815515c2f97924410 |
| signature |
The behaviour of `libc` `finite` functions is the same as Zig std's, so
the function basically delegates to `math.isFinite` and no new tests were
added. These functions are obsolete, but still part of `musl`.
No results are attached in this case as `libc-test` doesn't have tests for them.5 files changed, 10 insertions(+), 18 deletions(-)
lib/c/math.zig+10| ... | ... | @@ -62,6 +62,8 @@ comptime { |
| 62 | 62 | symbol(&exp10, "exp10"); |
| 63 | 63 | symbol(&exp10f, "exp10f"); |
| 64 | 64 | symbol(&fdim, "fdim"); |
| 65 | symbol(&finite, "finite"); | |
| 66 | symbol(&finitef, "finitef"); | |
| 65 | 67 | symbol(&frexp, "frexp"); |
| 66 | 68 | symbol(&hypot, "hypot"); |
| 67 | 69 | symbol(&modf, "modf"); |
| ... | ... | @@ -164,6 +166,14 @@ fn fdim(x: f64, y: f64) callconv(.c) f64 { |
| 164 | 166 | return 0; |
| 165 | 167 | } |
| 166 | 168 | |
| 169 | fn finite(x: f64) callconv(.c) c_int { | |
| 170 | return if (math.isFinite(x)) 1 else 0; | |
| 171 | } | |
| 172 | ||
| 173 | fn finitef(x: f32) callconv(.c) c_int { | |
| 174 | return if (math.isFinite(x)) 1 else 0; | |
| 175 | } | |
| 176 | ||
| 167 | 177 | fn frexpGeneric(comptime T: type, x: T, e: *c_int) T { |
| 168 | 178 | // libc expects `*e` to be unspecified in this case; an unspecified C value |
| 169 | 179 | // should be a valid value of the relevant type, yet Zig's std |
lib/libc/musl/src/math/finite.c deleted-7| ... | ... | @@ -1,7 +0,0 @@ |
| 1 | #define _GNU_SOURCE | |
| 2 | #include <math.h> | |
| 3 | ||
| 4 | int finite(double x) | |
| 5 | { | |
| 6 | 	return isfinite(x); | |
| 7 | } |
lib/libc/musl/src/math/finitef.c deleted-7| ... | ... | @@ -1,7 +0,0 @@ |
| 1 | #define _GNU_SOURCE | |
| 2 | #include <math.h> | |
| 3 | ||
| 4 | int finitef(float x) | |
| 5 | { | |
| 6 | 	return isfinite(x); | |
| 7 | } |
src/libs/musl.zig-2| ... | ... | @@ -831,8 +831,6 @@ const src_files = [_][]const u8{ |
| 831 | 831 | "musl/src/math/__expo2f.c", |
| 832 | 832 | "musl/src/math/fdimf.c", |
| 833 | 833 | "musl/src/math/fdiml.c", |
| 834 | "musl/src/math/finite.c", | |
| 835 | "musl/src/math/finitef.c", | |
| 836 | 834 | "musl/src/math/fma.c", |
| 837 | 835 | "musl/src/math/fmaf.c", |
| 838 | 836 | "musl/src/math/fmal.c", |
src/libs/wasi_libc.zig-2| ... | ... | @@ -697,8 +697,6 @@ const libc_top_half_src_files = [_][]const u8{ |
| 697 | 697 | "musl/src/math/expm1l.c", |
| 698 | 698 | "musl/src/math/fdimf.c", |
| 699 | 699 | "musl/src/math/fdiml.c", |
| 700 | "musl/src/math/finite.c", | |
| 701 | "musl/src/math/finitef.c", | |
| 702 | 700 | "musl/src/math/fma.c", |
| 703 | 701 | "musl/src/math/fmaf.c", |
| 704 | 702 | "musl/src/math/ilogb.c", |