Skip to content

Commit b1e2f04

Browse files
committed
libcore: Use correct link name for lgamma_r on win32
1 parent c74d5ce commit b1e2f04

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/libcore/cmath.rs

+5
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,13 @@ native mod c_double {
4747
pure fn frexp(n: c_double, &value: c_int) -> c_double;
4848
pure fn hypot(x: c_double, y: c_double) -> c_double;
4949
pure fn ldexp(x: c_double, n: c_int) -> c_double;
50+
#[cfg(target_os = "linux")]
51+
#[cfg(target_os = "macos")]
5052
#[link_name="lgamma_r"] pure fn lgamma(n: c_double,
5153
&sign: c_int) -> c_double;
54+
#[cfg(target_os = "win32")]
55+
#[link_name="__lgamma_r"] pure fn lgamma(n: c_double,
56+
&sign: c_int) -> c_double;
5257
// renamed: log is a reserved keyword; ln seems more natural, too
5358
#[link_name="log"] pure fn ln(n: c_double) -> c_double;
5459
// renamed: "logb" /often/ is confused for log2 by beginners

0 commit comments

Comments
 (0)