| ... | @@ -723,25 +723,25 @@ comptime { | ... | @@ -723,25 +723,25 @@ comptime { |
| 723 | @export(_aullrem, .{ .name = "\x01__aullrem", .linkage = strong_linkage }); | 723 | @export(_aullrem, .{ .name = "\x01__aullrem", .linkage = strong_linkage }); |
| 724 | } | 724 | } |
| 725 | | 725 | |
| 726 | mathExport("ceil", @import("./compiler_rt/ceil.zig")); | 726 | mathExport("ceil", @import("./compiler_rt/ceil.zig"), true); |
| 727 | mathExport("cos", @import("./compiler_rt/cos.zig")); | 727 | mathExport("cos", @import("./compiler_rt/cos.zig"), true); |
| 728 | mathExport("exp", @import("./compiler_rt/exp.zig")); | 728 | mathExport("exp", @import("./compiler_rt/exp.zig"), true); |
| 729 | mathExport("exp2", @import("./compiler_rt/exp2.zig")); | 729 | mathExport("exp2", @import("./compiler_rt/exp2.zig"), true); |
| 730 | mathExport("fabs", @import("./compiler_rt/fabs.zig")); | 730 | mathExport("fabs", @import("./compiler_rt/fabs.zig"), true); |
| 731 | mathExport("floor", @import("./compiler_rt/floor.zig")); | 731 | mathExport("floor", @import("./compiler_rt/floor.zig"), true); |
| 732 | mathExport("fma", @import("./compiler_rt/fma.zig")); | 732 | mathExport("fma", @import("./compiler_rt/fma.zig"), true); |
| 733 | mathExport("fmax", @import("./compiler_rt/fmax.zig")); | 733 | mathExport("fmax", @import("./compiler_rt/fmax.zig"), true); |
| 734 | mathExport("fmin", @import("./compiler_rt/fmin.zig")); | 734 | mathExport("fmin", @import("./compiler_rt/fmin.zig"), true); |
| 735 | mathExport("fmod", @import("./compiler_rt/fmod.zig")); | 735 | mathExport("fmod", @import("./compiler_rt/fmod.zig"), true); |
| 736 | mathExport("log", @import("./compiler_rt/log.zig")); | 736 | mathExport("log", @import("./compiler_rt/log.zig"), true); |
| 737 | mathExport("log10", @import("./compiler_rt/log10.zig")); | 737 | mathExport("log10", @import("./compiler_rt/log10.zig"), true); |
| 738 | mathExport("log2", @import("./compiler_rt/log2.zig")); | 738 | mathExport("log2", @import("./compiler_rt/log2.zig"), true); |
| 739 | mathExport("round", @import("./compiler_rt/round.zig")); | 739 | mathExport("round", @import("./compiler_rt/round.zig"), true); |
| 740 | mathExport("sin", @import("./compiler_rt/sin.zig")); | 740 | mathExport("sin", @import("./compiler_rt/sin.zig"), true); |
| 741 | mathExport("sincos", @import("./compiler_rt/sincos.zig")); | 741 | mathExport("sincos", @import("./compiler_rt/sincos.zig"), true); |
| 742 | mathExport("sqrt", @import("./compiler_rt/sqrt.zig")); | 742 | mathExport("sqrt", @import("./compiler_rt/sqrt.zig"), true); |
| 743 | mathExport("tan", @import("./compiler_rt/tan.zig")); | 743 | mathExport("tan", @import("./compiler_rt/tan.zig"), false); |
| 744 | mathExport("trunc", @import("./compiler_rt/trunc.zig")); | 744 | mathExport("trunc", @import("./compiler_rt/trunc.zig"), true); |
| 745 | | 745 | |
| 746 | if (arch.isSPARC()) { | 746 | if (arch.isSPARC()) { |
| 747 | // SPARC systems use a different naming scheme | 747 | // SPARC systems use a different naming scheme |
| ... | @@ -827,7 +827,7 @@ comptime { | ... | @@ -827,7 +827,7 @@ comptime { |
| 827 | } | 827 | } |
| 828 | } | 828 | } |
| 829 | | 829 | |
| 830 | inline fn mathExport(double_name: []const u8, comptime import: type) void { | 830 | inline fn mathExport(double_name: []const u8, comptime import: type, is_standard: bool) void { |
| 831 | const half_name = "__" ++ double_name ++ "h"; | 831 | const half_name = "__" ++ double_name ++ "h"; |
| 832 | const half_fn = @field(import, half_name); | 832 | const half_fn = @field(import, half_name); |
| 833 | const float_name = double_name ++ "f"; | 833 | const float_name = double_name ++ "f"; |
| ... | @@ -853,11 +853,15 @@ inline fn mathExport(double_name: []const u8, comptime import: type) void { | ... | @@ -853,11 +853,15 @@ inline fn mathExport(double_name: []const u8, comptime import: type) void { |
| 853 | .{ f128, quad_fn }, | 853 | .{ f128, quad_fn }, |
| 854 | }; | 854 | }; |
| 855 | | 855 | |
| 856 | inline for (pairs) |pair| { | 856 | // Weak aliases don't work on Windows, so we avoid exporting the `l` alias |
| 857 | const F = pair[0]; | 857 | // on this platform for functions we know will collide. |
| 858 | const func = pair[1]; | 858 | if (builtin.os.tag != .windows or !builtin.link_libc or !is_standard) { |
| 859 | if (builtin.target.longDoubleIs(F)) { | 859 | inline for (pairs) |pair| { |
| 860 | @export(func, .{ .name = long_double_name, .linkage = linkage }); | 860 | const F = pair[0]; |
| | 861 | const func = pair[1]; |
| | 862 | if (builtin.target.longDoubleIs(F)) { |
| | 863 | @export(func, .{ .name = long_double_name, .linkage = linkage }); |
| | 864 | } |
| 861 | } | 865 | } |
| 862 | } | 866 | } |
| 863 | } | 867 | } |