Skip to content

Commit

Permalink
android: Remove libstd hacks for unsupported Android APIs
Browse files Browse the repository at this point in the history
Our minimum supported API version is 21, remove hacks to support older
Android APIs.
  • Loading branch information
maurer committed Jul 30, 2024
1 parent f8060d2 commit 6357d41
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 100 deletions.
21 changes: 7 additions & 14 deletions library/std/src/sys/pal/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,21 +77,14 @@ cfg_if::cfg_if! {
}

#[cfg(not(test))]
cfg_if::cfg_if! {
if #[cfg(target_os = "android")] {
pub use self::android::log2f32;
pub use self::android::log2f64;
} else {
#[inline]
pub fn log2f32(n: f32) -> f32 {
unsafe { crate::intrinsics::log2f32(n) }
}
#[inline]
pub fn log2f32(n: f32) -> f32 {
unsafe { crate::intrinsics::log2f32(n) }
}

#[inline]
pub fn log2f64(n: f64) -> f64 {
unsafe { crate::intrinsics::log2f64(n) }
}
}
#[inline]
pub fn log2f64(n: f64) -> f64 {
unsafe { crate::intrinsics::log2f64(n) }
}

#[cfg(not(target_os = "uefi"))]
Expand Down
81 changes: 0 additions & 81 deletions library/std/src/sys/pal/unix/android.rs

This file was deleted.

5 changes: 0 additions & 5 deletions library/std/src/sys/pal/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use crate::io::ErrorKind;
pub mod weak;

pub mod alloc;
pub mod android;
pub mod args;
pub mod env;
pub mod fd;
Expand Down Expand Up @@ -237,12 +236,8 @@ pub unsafe fn cleanup() {
}

#[allow(unused_imports)]
#[cfg(not(target_os = "android"))]
pub use libc::signal;

#[cfg(target_os = "android")]
pub use crate::sys::android::signal;

#[inline]
pub(crate) fn is_interrupted(errno: i32) -> bool {
errno == libc::EINTR
Expand Down

0 comments on commit 6357d41

Please sign in to comment.