auto merge of #4900 : luqmana/rust/core_os_errors, r=graydon
Rewrote the last pull request (#4859) to not require on llvm for core. Also fixes #2269.
This commit is contained in:
commit
6016214101
11 changed files with 148 additions and 69 deletions
|
|
@ -15,5 +15,5 @@
|
|||
|
||||
#[crate_type = "lib"];
|
||||
extern {
|
||||
fn last_os_error() -> ~str;
|
||||
fn rust_get_argc() -> libc::c_int;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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!();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,5 +15,5 @@ extern mod anonexternmod;
|
|||
use anonexternmod::*;
|
||||
|
||||
pub fn main() {
|
||||
last_os_error();
|
||||
rust_get_argc();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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(); } }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue