aboutsummaryrefslogtreecommitdiff
path: root/lib/compiler_rt/fmod.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2022-05-08 19:29:21 -0400
committerGitHub <noreply@github.com>2022-05-08 19:29:21 -0400
commitd7f8368da86241f47e97257e737b6fb14bf5f773 (patch)
tree260d9d2d3aa68a96d1ea7594234fae0c3b90640e /lib/compiler_rt/fmod.zig
parentea3f5905f0635d0c0cb3983ba5ca6c92859e9d81 (diff)
parentcd019ee502d6792c1615b0fab10827db419beab4 (diff)
downloadzig-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.zig11
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);