Skip to content

Commit

Permalink
Merge pull request servo#11 from ozkriff/master
Browse files Browse the repository at this point in the history
android: Updated for rust e583c4d24 2014-11-21 09:01:50 +0000
  • Loading branch information
tomaka committed Nov 21, 2014
2 parents 3b34736 + e673c08 commit 70636e9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions glue/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
extern crate compile_msg;

extern crate libc;
extern crate native;

use std::sync::Mutex;

Expand Down Expand Up @@ -62,7 +61,6 @@ macro_rules! android_start(
/// This is the function that must be called by `android_main`
#[doc(hidden)]
pub fn android_main2(app: *mut (), main_function: proc(): Send) {
use native::NativeTaskBuilder;
use std::task::TaskBuilder;
use std::{mem, ptr};

Expand All @@ -72,15 +70,15 @@ pub fn android_main2(app: *mut (), main_function: proc(): Send) {
let app: &mut ffi::android_app = unsafe { std::mem::transmute(app) };

// starting the runtime
native::start(1, &b"".as_ptr(), proc() {
std::rt::start(1, &b"".as_ptr(), proc() {
// creating the context that will be passed to the callback
let context = Context { senders: Mutex::new(Vec::new()) };
app.onAppCmd = commands_callback;
app.onInputEvent = inputs_callback;
app.userData = unsafe { std::mem::transmute(&context) };

// executing the main function in parallel
TaskBuilder::new().native().spawn(proc() {
spawn(proc() {
std::io::stdio::set_stdout(box std::io::LineBufferedWriter::new(ToLogWriter));
std::io::stdio::set_stderr(box std::io::LineBufferedWriter::new(ToLogWriter));
main_function()
Expand Down

0 comments on commit 70636e9

Please sign in to comment.