Fix compilation on linux

This commit is contained in:
Alex Crichton 2014-12-10 07:37:33 -08:00 committed by Aaron Turon
parent 9644d60cc4
commit 7a6c54c46e
3 changed files with 8 additions and 9 deletions

View File

@ -57,7 +57,6 @@ use sync::atomic::{AtomicInt, INIT_ATOMIC_INT, SeqCst};
use vec::Vec;
#[cfg(unix)] use c_str::ToCStr;
#[cfg(unix)] use libc::c_char;
#[cfg(unix)]
pub use sys::ext as unix;

View File

@ -51,10 +51,10 @@ mod imp {
use string::String;
use mem;
use sync::mutex::{StaticMutex, MUTEX_INIT};
use sync::{StaticMutex, MUTEX_INIT};
static mut GLOBAL_ARGS_PTR: uint = 0;
static LOCK: NativeMutex = MUTEX_INIT;
static LOCK: StaticMutex = MUTEX_INIT;
pub unsafe fn init(argc: int, argv: *const *const u8) {
let args = load_argc_and_argv(argc, argv);
@ -67,7 +67,7 @@ mod imp {
}
pub fn take() -> Option<Vec<Vec<u8>>> {
let guard = LOCK.lock();
let _guard = LOCK.lock();
unsafe {
let ptr = get_global_ptr();
let val = mem::replace(&mut *ptr, None);
@ -76,7 +76,7 @@ mod imp {
}
pub fn put(args: Vec<Vec<u8>>) {
let guard = LOCK.lock();
let _guard = LOCK.lock();
unsafe {
let ptr = get_global_ptr();
rtassert!((*ptr).is_none());
@ -85,7 +85,7 @@ mod imp {
}
pub fn clone() -> Option<Vec<Vec<u8>>> {
let guard = LOCK.lock();
let _guard = LOCK.lock();
unsafe {
let ptr = get_global_ptr();
(*ptr).as_ref().map(|s: &Box<Vec<Vec<u8>>>| (**s).clone())
@ -104,8 +104,8 @@ mod imp {
#[cfg(test)]
mod tests {
use std::prelude::*;
use std::finally::Finally;
use prelude::*;
use finally::Finally;
use super::*;

View File

@ -241,7 +241,7 @@ fn print(w: &mut Writer, idx: int, addr: *mut libc::c_void) -> IoResult<()> {
#[cfg(not(any(target_os = "macos", target_os = "ios")))]
fn print(w: &mut Writer, idx: int, addr: *mut libc::c_void) -> IoResult<()> {
use iter::Iterator;
use iter::{Iterator, IteratorExt};
use os;
use path::GenericPath;
use ptr::RawPtr;