mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Update rustc to 00b112c45a604fa6f4b59af2a40c9deeadfdb7c6/rustc-1.0.0-dev.
This commit is contained in:
parent
ff8cbff810
commit
95fc29fa0d
255 changed files with 3550 additions and 3362 deletions
|
@ -2,8 +2,6 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#![feature(phase)]
|
||||
|
||||
#![deny(unused_imports)]
|
||||
#![deny(unused_variables)]
|
||||
|
||||
|
@ -23,7 +21,7 @@ extern crate "glfw_app" as app;
|
|||
extern crate compositing;
|
||||
|
||||
#[cfg(target_os="android")]
|
||||
#[phase(plugin, link)]
|
||||
#[macro_use]
|
||||
extern crate android_glue;
|
||||
|
||||
#[cfg(target_os="android")]
|
||||
|
@ -49,7 +47,7 @@ struct BrowserWrapper {
|
|||
}
|
||||
|
||||
#[cfg(target_os="android")]
|
||||
android_start!(main)
|
||||
android_start!(main);
|
||||
|
||||
#[cfg(target_os="android")]
|
||||
fn get_args() -> Vec<String> {
|
||||
|
@ -64,30 +62,37 @@ fn get_args() -> Vec<String> {
|
|||
os::args()
|
||||
}
|
||||
|
||||
#[cfg(target_os="android")]
|
||||
struct FilePtr(*mut libc::types::common::c95::FILE);
|
||||
|
||||
#[cfg(target_os="android")]
|
||||
unsafe impl Send for FilePtr {}
|
||||
|
||||
#[cfg(target_os="android")]
|
||||
fn redirect_output(file_no: c_int) {
|
||||
use libc::funcs::posix88::unistd::{pipe, dup2};
|
||||
use libc::funcs::posix88::stdio::fdopen;
|
||||
use libc::c_char;
|
||||
use libc::funcs::c95::stdio::fgets;
|
||||
use servo_util::task::spawn_named;
|
||||
use std::mem;
|
||||
use std::c_str::CString;
|
||||
use std::ffi::CString;
|
||||
use std::str::from_utf8;
|
||||
|
||||
unsafe {
|
||||
let mut pipes: [c_int, ..2] = [ 0, 0 ];
|
||||
let mut pipes: [c_int; 2] = [ 0, 0 ];
|
||||
pipe(pipes.as_mut_ptr());
|
||||
dup2(pipes[1], file_no);
|
||||
let input_file = "r".with_c_str(|mode| {
|
||||
fdopen(pipes[0], mode)
|
||||
});
|
||||
spawn(proc() {
|
||||
let mode = CString::from_slice("r".as_bytes());
|
||||
let input_file = FilePtr(fdopen(pipes[0], mode.as_ptr()));
|
||||
spawn_named("android-logger".to_owned(), move || {
|
||||
loop {
|
||||
let mut read_buffer: [c_char, ..1024] = mem::zeroed();
|
||||
fgets(read_buffer.as_mut_ptr(), read_buffer.len() as i32, input_file);
|
||||
let cs = CString::new(read_buffer.as_ptr(), false);
|
||||
match cs.as_str() {
|
||||
Some(s) => android_glue::write_log(s),
|
||||
None => {},
|
||||
let mut read_buffer: [u8; 1024] = mem::zeroed();
|
||||
let FilePtr(input_file) = input_file;
|
||||
fgets(read_buffer.as_mut_ptr() as *mut i8, read_buffer.len() as i32, input_file);
|
||||
let cs = CString::from_slice(&read_buffer);
|
||||
match from_utf8(cs.as_bytes()) {
|
||||
Ok(s) => android_glue::write_log(s),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue