about summary refs log tree commit diff
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2015-03-06 09:00:34 +0530
committerManish Goregaokar <manishsmail@gmail.com>2015-03-06 09:00:34 +0530
commitc39833ed2d307df3b1f969a83fb9b834fb36de25 (patch)
treea73545d85cdfdef9d36e4845ee70724773c7f286
parent7a12c038a5a27403a72274af2fa603abe157da3d (diff)
parent29938fff3802243bdfe9a12860384d8eade20a7a (diff)
downloadrust-c39833ed2d307df3b1f969a83fb9b834fb36de25.tar.gz
rust-c39833ed2d307df3b1f969a83fb9b834fb36de25.zip
Rollup merge of #23070 - krdln:fix-stat-arm, r=alexcrichton
 This separates definitions of struct stat and other typedefs between Android and Linux on ARM (Android has a non-standard one). This makes functions such as `File::metadata()` work correctly and makes one able to check file's size. All tests from std (and also run-pass: stat.rs) now pass on ARM Linux. Fixes #20007.
-rw-r--r--src/liblibc/lib.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/liblibc/lib.rs b/src/liblibc/lib.rs
index f1a1f301616..c0b9b67758e 100644
--- a/src/liblibc/lib.rs
+++ b/src/liblibc/lib.rs
@@ -383,7 +383,8 @@ pub mod types {
                       target_arch = "mips",
                       target_arch = "mipsel",
                       target_arch = "powerpc",
-                      target_arch = "le32"))]
+                      target_arch = "le32",
+                      all(target_arch = "arm", not(target_os = "android"))))]
             pub mod posix88 {
                 pub type off_t = i32;
                 pub type dev_t = u64;
@@ -395,7 +396,7 @@ pub mod types {
                 pub type mode_t = u32;
                 pub type ssize_t = i32;
             }
-            #[cfg(target_arch = "arm")]
+            #[cfg(all(target_arch = "arm", target_os = "android"))]
             pub mod posix88 {
                 pub type off_t = i32;
                 pub type dev_t = u32;
@@ -409,7 +410,8 @@ pub mod types {
             }
             #[cfg(any(target_arch = "x86",
                       target_arch = "le32",
-                      target_arch = "powerpc"))]
+                      target_arch = "powerpc",
+                      all(target_arch = "arm", not(target_os = "android"))))]
             pub mod posix01 {
                 use types::os::arch::c95::{c_short, c_long, time_t};
                 use types::os::arch::posix88::{dev_t, gid_t, ino_t};
@@ -455,7 +457,7 @@ pub mod types {
                     pub __size: [u32; 9]
                 }
             }
-            #[cfg(target_arch = "arm")]
+            #[cfg(all(target_arch = "arm", target_os = "android"))]
             pub mod posix01 {
                 use types::os::arch::c95::{c_uchar, c_uint, c_ulong, time_t};
                 use types::os::arch::c99::{c_longlong, c_ulonglong};