Skip to content

Commit e3b8a22

Browse files
authored
Merge pull request #250 from japaric/fmod
expose fmod{,f} symbols on thumb
2 parents b4a3645 + 1083ac1 commit e3b8a22

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

Diff for: src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ mod macros;
4747
pub mod int;
4848
pub mod float;
4949

50-
pub mod mem;
51-
// only for the wasm32-unknown-unknown target
52-
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
50+
#[cfg(any(all(target_arch = "wasm32", target_os = "unknown"),
51+
all(target_arch = "arm", target_os = "none")))]
5352
pub mod math;
53+
pub mod mem;
5454

5555
#[cfg(target_arch = "arm")]
5656
pub mod arm;

Diff for: src/math.rs

+11
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ macro_rules! no_mangle {
1414
}
1515
}
1616

17+
// only for the wasm32-unknown-unknown target
18+
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
1719
no_mangle! {
1820
fn acos(x: f64) -> f64;
1921
fn asin(x: f64) -> f64;
@@ -50,3 +52,12 @@ no_mangle! {
5052
fn fma(x: f64, y: f64, z: f64) -> f64;
5153
fn fmaf(x: f32, y: f32, z: f32) -> f32;
5254
}
55+
56+
// only for the thumb*-none-eabi* targets
57+
#[cfg(all(target_arch = "arm", target_os = "none"))]
58+
no_mangle! {
59+
// `f64 % f64`
60+
fn fmod(x: f64, y: f64) -> f64;
61+
// `f32 % f32`
62+
fn fmodf(x: f32, y: f32) -> f32;
63+
}

0 commit comments

Comments
 (0)