diff --git a/Makefile.in b/Makefile.in index 551e3a3..00ed259 100644 --- a/Makefile.in +++ b/Makefile.in @@ -19,7 +19,7 @@ all: librustglut.dummy $(CC) $< -o $@ -c $(CFLAGS) librustglut.dummy: glut.rc $(RUST_SRC) libandroid-glue.a - $(RUSTC) $(RUSTFLAGS) $< --out-dir . --lib + $(RUSTC) $(RUSTFLAGS) $< --out-dir . --crate-type=lib touch $@ rustglut-test: glut.rc $(RUST_SRC) libandroid-glue.a diff --git a/glut.rc b/glut.rc index c174b0f..47bbac4 100644 --- a/glut.rc +++ b/glut.rc @@ -12,7 +12,7 @@ #[feature(macro_rules)]; -extern mod std; +extern crate std; pub mod glut; diff --git a/glut.rs b/glut.rs index 7b548d8..359fda2 100644 --- a/glut.rs +++ b/glut.rs @@ -12,7 +12,7 @@ use std::cast; use std::libc::{c_int, c_uint, c_uchar, c_char}; use std::local_data; -use std::ptr::{null, to_unsafe_ptr}; +use std::ptr::null; /* FIXME: global variable glutStrokeRoman */ @@ -100,8 +100,8 @@ pub fn init() { let glut = ~"glut"; glut.to_c_str().with_ref(|command| { let argv: (*u8, *u8) = (command as *u8, null()); - let argv_p = cast::transmute(to_unsafe_ptr(&argv)); - glutInit(to_unsafe_ptr(&argc), argv_p); + let argv_p = cast::transmute(&argv); + glutInit(&argc, argv_p); }); } } @@ -116,13 +116,15 @@ pub fn create_window(name: ~str) -> Window { pub fn destroy_window(window: Window) { unsafe { - glutDestroyWindow(*window); + let Window(i) = window; + glutDestroyWindow(i); } } pub fn set_window(window: Window) { unsafe { - glutSetWindow(*window); + let Window(i) = window; + glutSetWindow(i); } } @@ -138,7 +140,8 @@ pub fn set_window_title(_window: Window, title: &str) { pub fn reshape_window(window: Window, width: c_int, height: c_int) { unsafe { let current_window = glutGetWindow(); - glutSetWindow(*window); + let Window(i) = window; + glutSetWindow(i); glutReshapeWindow(width, height); glutSetWindow(current_window); } diff --git a/machack.rs b/machack.rs index ea2f3ed..c8dd9b5 100644 --- a/machack.rs +++ b/machack.rs @@ -1,6 +1,6 @@ #[allow(non_uppercase_statics)]; -extern mod cocoa; +extern crate cocoa; use glut::{mouse_callback_tls_key, mouse_wheel_callback_tls_key}; diff --git a/test.rs b/test.rs index eb397c9..b5eb01f 100644 --- a/test.rs +++ b/test.rs @@ -7,7 +7,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -extern mod opengles = "rust-opengles"; // FIXME: Should only be for tests. +extern crate opengles = "rust-opengles"; // FIXME: Should only be for tests. use glut::{swap_buffers, GLint}; use self::opengles::gl2::{ARRAY_BUFFER, COLOR_BUFFER_BIT, COMPILE_STATUS}; use self::opengles::gl2::{FRAGMENT_SHADER, LINK_STATUS, NO_ERROR, STATIC_DRAW};