Skip to content

Commit 6586619

Browse files
committed
android: Remove libstd hacks for unsupported Android APIs
Our minimum supported API version is 21, remove hacks to support older Android APIs.
1 parent f8060d2 commit 6586619

File tree

5 files changed

+2
-106
lines changed

5 files changed

+2
-106
lines changed

library/std/src/f32.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ impl f32 {
574574
#[stable(feature = "rust1", since = "1.0.0")]
575575
#[inline]
576576
pub fn log2(self) -> f32 {
577-
crate::sys::log2f32(self)
577+
intrinsics::log2f32(self)
578578
}
579579

580580
/// Returns the base 10 logarithm of the number.

library/std/src/f64.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ impl f64 {
574574
#[stable(feature = "rust1", since = "1.0.0")]
575575
#[inline]
576576
pub fn log2(self) -> f64 {
577-
crate::sys::log2f64(self)
577+
intrinsics::log2f64(self)
578578
}
579579

580580
/// Returns the base 10 logarithm of the number.

library/std/src/sys/pal/mod.rs

-18
Original file line numberDiff line numberDiff line change
@@ -76,23 +76,5 @@ cfg_if::cfg_if! {
7676
}
7777
}
7878

79-
#[cfg(not(test))]
80-
cfg_if::cfg_if! {
81-
if #[cfg(target_os = "android")] {
82-
pub use self::android::log2f32;
83-
pub use self::android::log2f64;
84-
} else {
85-
#[inline]
86-
pub fn log2f32(n: f32) -> f32 {
87-
unsafe { crate::intrinsics::log2f32(n) }
88-
}
89-
90-
#[inline]
91-
pub fn log2f64(n: f64) -> f64 {
92-
unsafe { crate::intrinsics::log2f64(n) }
93-
}
94-
}
95-
}
96-
9779
#[cfg(not(target_os = "uefi"))]
9880
pub type RawOsError = i32;

library/std/src/sys/pal/unix/android.rs

-81
This file was deleted.

library/std/src/sys/pal/unix/mod.rs

-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use crate::io::ErrorKind;
88
pub mod weak;
99

1010
pub mod alloc;
11-
pub mod android;
1211
pub mod args;
1312
pub mod env;
1413
pub mod fd;
@@ -237,12 +236,8 @@ pub unsafe fn cleanup() {
237236
}
238237

239238
#[allow(unused_imports)]
240-
#[cfg(not(target_os = "android"))]
241239
pub use libc::signal;
242240

243-
#[cfg(target_os = "android")]
244-
pub use crate::sys::android::signal;
245-
246241
#[inline]
247242
pub(crate) fn is_interrupted(errno: i32) -> bool {
248243
errno == libc::EINTR

0 commit comments

Comments
 (0)