rt: remove last_os_error and adjust tests.

This commit is contained in:
Luqman Aden 2013-02-11 23:27:12 -05:00
parent 625fac3c7e
commit 70185fdcc2
10 changed files with 14 additions and 59 deletions

View file

@ -15,5 +15,5 @@
#[crate_type = "lib"];
extern {
fn last_os_error() -> ~str;
fn rust_get_argc() -> libc::c_int;
}

View file

@ -11,5 +11,5 @@
#[link(name="foreign_lib", vers="0.0")];
pub extern mod rustrt {
pub fn last_os_error() -> ~str;
pub fn rust_get_argc() -> libc::c_int;
}

View file

@ -18,7 +18,7 @@
extern mod std;
extern mod rustrt {
pub fn last_os_error() -> ~str;
pub fn rust_get_argc() -> libc::c_int;
}
fn getbig_call_c_and_fail(i: int) {
@ -26,7 +26,7 @@ fn getbig_call_c_and_fail(i: int) {
getbig_call_c_and_fail(i - 1);
} else {
unsafe {
rustrt::last_os_error();
rustrt::rust_get_argc();
die!();
}
}

View file

@ -15,5 +15,5 @@ extern mod anonexternmod;
use anonexternmod::*;
pub fn main() {
last_os_error();
rust_get_argc();
}

View file

@ -11,11 +11,11 @@
#[abi = "cdecl"]
#[link_name = "rustrt"]
extern {
fn last_os_error() -> ~str;
fn rust_get_argc() -> libc::c_int;
}
pub fn main() {
unsafe {
let _ = last_os_error();
let _ = rust_get_argc();
}
}

View file

@ -14,18 +14,18 @@
#[abi = "cdecl"]
#[link_name = "rustrt"]
extern mod rustrt1 {
pub fn last_os_error() -> ~str;
pub fn rust_get_argc() -> libc::c_int;
}
#[abi = "cdecl"]
#[link_name = "rustrt"]
extern mod rustrt2 {
pub fn last_os_error() -> ~str;
pub fn rust_get_argc() -> libc::c_int;
}
pub fn main() {
unsafe {
rustrt1::last_os_error();
rustrt2::last_os_error();
rustrt1::rust_get_argc();
rustrt2::rust_get_argc();
}
}

View file

@ -18,5 +18,5 @@
extern mod foreign_lib;
pub fn main() {
let foo = foreign_lib::rustrt::last_os_error();
let foo = foreign_lib::rustrt::rust_get_argc();
}

View file

@ -15,7 +15,7 @@ extern mod rustrt {
pub fn debug_get_stk_seg() -> *u8;
pub fn rust_get_sched_id() -> libc::intptr_t;
pub fn last_os_error() -> ~str;
pub fn rust_get_argc() -> libc::c_int;
pub fn rust_getcwd() -> ~str;
pub fn get_task_id() -> libc::intptr_t;
pub fn rust_sched_threads();
@ -23,7 +23,7 @@ extern mod rustrt {
}
fn calllink01() { unsafe { rustrt::rust_get_sched_id(); } }
fn calllink02() { unsafe { rustrt::last_os_error(); } }
fn calllink02() { unsafe { rustrt::rust_get_argc(); } }
fn calllink03() { unsafe { rustrt::rust_getcwd(); } }
fn calllink08() { unsafe { rustrt::get_task_id(); } }
fn calllink09() { unsafe { rustrt::rust_sched_threads(); } }