diff --git a/appkit.rs b/appkit.rs index 8a983a7..03a3705 100644 --- a/appkit.rs +++ b/appkit.rs @@ -8,6 +8,7 @@ // except according to those terms. use base; +use std::str; pub type CGFloat = f32; @@ -46,14 +47,14 @@ pub struct NSRect { #[nolink] #[link_args="-framework AppKit"] -pub extern mod appkit { +extern { fn NSBeep(); } pub fn NSApp() -> base::id { unsafe { - let klass = str::as_c_str(~"NSApplication", |s| base::objc_getClass(s)); - let sel = str::as_c_str(~"sharedApplication", |s| base::sel_registerName(s)); + let klass = str::as_c_str("NSApplication", |s| base::objc_getClass(s)); + let sel = str::as_c_str("sharedApplication", |s| base::sel_registerName(s)); base::objc_msgSend(klass, sel) } } diff --git a/base.rs b/base.rs index dab80fb..e14b94a 100644 --- a/base.rs +++ b/base.rs @@ -9,7 +9,10 @@ use appkit::NSRect; -use core::libc::c_long; +use std::libc; +use std::libc::c_long; +use std::io; +use std::str; pub type id = libc::intptr_t; pub type Class = libc::intptr_t; diff --git a/foundation.rs b/foundation.rs index b064484..d4344ce 100644 --- a/foundation.rs +++ b/foundation.rs @@ -8,10 +8,11 @@ // except according to those terms. use base; +use std::str; #[nolink] #[link_args="-framework Foundation"] -extern mod foundation { +extern { } enum NSAutoreleasePool { @@ -20,12 +21,12 @@ enum NSAutoreleasePool { fn NSAutoreleasePool() -> base::id { unsafe { - let klass = str::as_c_str(~"NSAutoreleasePool", |s| + let klass = str::as_c_str("NSAutoreleasePool", |s| base::objc_getClass(s) ); - let alloc_sel = str::as_c_str(~"alloc", |s| base::sel_registerName(s)); - let init_sel = str::as_c_str(~"init", |s| base::sel_registerName(s)); + let alloc_sel = str::as_c_str("alloc", |s| base::sel_registerName(s)); + let init_sel = str::as_c_str("init", |s| base::sel_registerName(s)); let pool = base::objc_msgSend(klass, alloc_sel); base::objc_msgSend(pool, init_sel)