Fix broken auto-mac-ios-opt build

This commit is contained in:
Nikita Baksalyar 2016-02-03 16:45:34 +03:00
parent bb6e646c7b
commit fae883c113
No known key found for this signature in database
GPG Key ID: 3EEA378A0EA758DA
2 changed files with 23 additions and 27 deletions

View File

@ -8,6 +8,7 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
use prelude::v1::*;
use io::prelude::*; use io::prelude::*;
use os::unix::prelude::*; use os::unix::prelude::*;
@ -23,11 +24,6 @@ use sys::fd::FileDesc;
use sys::platform::raw; use sys::platform::raw;
use sys::{cvt, cvt_r}; use sys::{cvt, cvt_r};
use sys_common::{AsInner, FromInner}; use sys_common::{AsInner, FromInner};
use vec::Vec;
#[cfg(target_os = "solaris")]
use core_collections::borrow::ToOwned;
#[cfg(target_os = "solaris")]
use boxed::Box;
pub struct File(FileDesc); pub struct File(FileDesc);

View File

@ -507,6 +507,14 @@ pub fn home_dir() -> Option<PathBuf> {
fallback() fallback()
}).map(PathBuf::from); }).map(PathBuf::from);
#[cfg(any(target_os = "android",
target_os = "ios",
target_os = "nacl"))]
unsafe fn fallback() -> Option<OsString> { None }
#[cfg(not(any(target_os = "android",
target_os = "ios",
target_os = "nacl")))]
unsafe fn fallback() -> Option<OsString> {
#[cfg(not(target_os = "solaris"))] #[cfg(not(target_os = "solaris"))]
unsafe fn getpwduid_r(me: libc::uid_t, passwd: &mut libc::passwd, unsafe fn getpwduid_r(me: libc::uid_t, passwd: &mut libc::passwd,
buf: &mut Vec<c_char>) -> Option<()> { buf: &mut Vec<c_char>) -> Option<()> {
@ -529,14 +537,6 @@ pub fn home_dir() -> Option<PathBuf> {
if result.is_null() { None } else { Some(()) } if result.is_null() { None } else { Some(()) }
} }
#[cfg(any(target_os = "android",
target_os = "ios",
target_os = "nacl"))]
unsafe fn fallback() -> Option<OsString> { None }
#[cfg(not(any(target_os = "android",
target_os = "ios",
target_os = "nacl")))]
unsafe fn fallback() -> Option<OsString> {
let amt = match libc::sysconf(libc::_SC_GETPW_R_SIZE_MAX) { let amt = match libc::sysconf(libc::_SC_GETPW_R_SIZE_MAX) {
n if n < 0 => 512 as usize, n if n < 0 => 512 as usize,
n => n as usize, n => n as usize,