aboutsummaryrefslogtreecommitdiff
path: root/lib/compiler_rt/exp.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/exp.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/exp.zig')
-rw-r--r--lib/compiler_rt/exp.zig11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/compiler_rt/exp.zig b/lib/compiler_rt/exp.zig
index 0f129dfd4c..a2c5d0e550 100644
--- a/lib/compiler_rt/exp.zig
+++ b/lib/compiler_rt/exp.zig
@@ -182,6 +182,17 @@ pub fn expq(a: f128) callconv(.C) f128 {
return exp(@floatCast(f64, a));
}
+pub fn expl(x: c_longdouble) callconv(.C) c_longdouble {
+ switch (@typeInfo(c_longdouble).Float.bits) {
+ 16 => return __exph(x),
+ 32 => return expf(x),
+ 64 => return exp(x),
+ 80 => return __expx(x),
+ 128 => return expq(x),
+ else => @compileError("unreachable"),
+ }
+}
+
test "exp32" {
const epsilon = 0.000001;