Skip to content

expose fmod{,f} symbols on thumb #250

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ mod macros;
pub mod int;
pub mod float;

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

#[cfg(target_arch = "arm")]
pub mod arm;
Expand Down
11 changes: 11 additions & 0 deletions src/math.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ macro_rules! no_mangle {
}
}

// only for the wasm32-unknown-unknown target
#[cfg(all(target_arch = "wasm32", target_os = "unknown"))]
no_mangle! {
fn acos(x: f64) -> f64;
fn asin(x: f64) -> f64;
Expand Down Expand Up @@ -50,3 +52,12 @@ no_mangle! {
fn fma(x: f64, y: f64, z: f64) -> f64;
fn fmaf(x: f32, y: f32, z: f32) -> f32;
}

// only for the thumb*-none-eabi* targets
#[cfg(all(target_arch = "arm", target_os = "none"))]
no_mangle! {
// `f64 % f64`
fn fmod(x: f64, y: f64) -> f64;
// `f32 % f32`
fn fmodf(x: f32, y: f32) -> f32;
}