Skip to content

Commit 68cf2e9

Browse files
authored
Merge pull request #518 from ankane/lgamma
2 parents 39ad246 + a8c4088 commit 68cf2e9

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

src/math.rs

+25
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,31 @@ no_mangle! {
8686
fn tanf(n: f32) -> f32;
8787
}
8888

89+
#[cfg(any(
90+
all(
91+
target_family = "wasm",
92+
target_os = "unknown",
93+
not(target_env = "wasi")
94+
),
95+
target_os = "xous",
96+
all(target_arch = "x86_64", target_os = "uefi"),
97+
all(target_arch = "xtensa", target_os = "none"),
98+
all(target_vendor = "fortanix", target_env = "sgx")
99+
))]
100+
intrinsics! {
101+
pub extern "C" fn lgamma_r(x: f64, s: &mut i32) -> f64 {
102+
let r = self::libm::lgamma_r(x);
103+
*s = r.1;
104+
r.0
105+
}
106+
107+
pub extern "C" fn lgammaf_r(x: f32, s: &mut i32) -> f32 {
108+
let r = self::libm::lgammaf_r(x);
109+
*s = r.1;
110+
r.0
111+
}
112+
}
113+
89114
#[cfg(any(
90115
target_os = "xous",
91116
target_os = "uefi",

0 commit comments

Comments
 (0)