diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-05-08 19:29:21 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-08 19:29:21 -0400 |
| commit | d7f8368da86241f47e97257e737b6fb14bf5f773 (patch) | |
| tree | 260d9d2d3aa68a96d1ea7594234fae0c3b90640e /lib/compiler_rt/fmod.zig | |
| parent | ea3f5905f0635d0c0cb3983ba5ca6c92859e9d81 (diff) | |
| parent | cd019ee502d6792c1615b0fab10827db419beab4 (diff) | |
| download | zig-d7f8368da86241f47e97257e737b6fb14bf5f773.tar.gz zig-d7f8368da86241f47e97257e737b6fb14bf5f773.zip | |
Merge pull request #11609 from ziglang/win-compiler-rt
compiler-rt: avoid symbol collisions with Windows libc
Diffstat (limited to 'lib/compiler_rt/fmod.zig')
| -rw-r--r-- | lib/compiler_rt/fmod.zig | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/compiler_rt/fmod.zig b/lib/compiler_rt/fmod.zig index 28e0df3d6b..5d413ca37d 100644 --- a/lib/compiler_rt/fmod.zig +++ b/lib/compiler_rt/fmod.zig @@ -237,6 +237,17 @@ pub fn fmodq(a: f128, b: f128) callconv(.C) f128 { return amod; } +pub fn fmodl(a: c_longdouble, b: c_longdouble) callconv(.C) c_longdouble { + switch (@typeInfo(c_longdouble).Float.bits) { + 16 => return __fmodh(a, b), + 32 => return fmodf(a, b), + 64 => return fmod(a, b), + 80 => return __fmodx(a, b), + 128 => return fmodq(a, b), + else => @compileError("unreachable"), + } +} + inline fn generic_fmod(comptime T: type, x: T, y: T) T { @setRuntimeSafety(false); |
