Skip to content

Commit 3d00562

Browse files
committed
expose fmod{,f} symbols on thumb
these symbols are required for the built-in operation `f32 % f32`
1 parent b4a3645 commit 3d00562

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,8 @@ 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"))]
5350
pub mod math;
51+
pub mod mem;
5452

5553
#[cfg(target_arch = "arm")]
5654
pub mod arm;

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)