diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2013-05-09 14:14:42 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2013-05-12 16:33:15 -0700 |
| commit | 06ef889cdc77db862d526bf6a607ecdf3ee80beb (patch) | |
| tree | 12ef3b970735baece127e674d7feb82bd6a5d9da /src/libcore | |
| parent | 830b945a9db072b68970b6f83dfafc1aaff8f837 (diff) | |
| download | rust-06ef889cdc77db862d526bf6a607ecdf3ee80beb.tar.gz rust-06ef889cdc77db862d526bf6a607ecdf3ee80beb.zip | |
libsyntax: Remove `extern mod foo { ... }` from the language.
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/os.rs | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/src/libcore/os.rs b/src/libcore/os.rs index 030b7ec3e42..d983377245c 100644 --- a/src/libcore/os.rs +++ b/src/libcore/os.rs @@ -196,10 +196,10 @@ pub fn env() -> ~[(~str,~str)] { } #[cfg(unix)] unsafe fn get_env_pairs() -> ~[~str] { - extern mod rustrt { + extern { unsafe fn rust_env_pairs() -> **libc::c_char; } - let environ = rustrt::rust_env_pairs(); + let environ = rust_env_pairs(); if (environ as uint == 0) { fail!(fmt!("os::env() failure getting env string from OS: %s", os::last_os_error())); @@ -685,9 +685,8 @@ pub fn list_dir(p: &Path) -> ~[~str] { unsafe fn get_list(p: &Path) -> ~[~str] { use libc::{dirent_t}; use libc::{opendir, readdir, closedir}; - extern mod rustrt { - unsafe fn rust_list_dir_val(ptr: *dirent_t) - -> *libc::c_char; + extern { + unsafe fn rust_list_dir_val(ptr: *dirent_t) -> *libc::c_char; } let input = p.to_str(); let mut strings = ~[]; @@ -698,10 +697,8 @@ pub fn list_dir(p: &Path) -> ~[~str] { debug!("os::list_dir -- opendir() SUCCESS"); let mut entry_ptr = readdir(dir_ptr); while (entry_ptr as uint != 0) { - strings.push( - str::raw::from_c_str( - rustrt::rust_list_dir_val( - entry_ptr))); + strings.push(str::raw::from_c_str(rust_list_dir_val( + entry_ptr))); entry_ptr = readdir(dir_ptr); } closedir(dir_ptr); @@ -729,7 +726,7 @@ pub fn list_dir(p: &Path) -> ~[~str] { }; use unstable::exchange_alloc::{malloc_raw, free_raw}; #[nolink] - extern mod rustrt { + extern { unsafe fn rust_list_dir_wfd_size() -> libc::size_t; unsafe fn rust_list_dir_wfd_fp_buf(wfd: *libc::c_void) -> *u16; @@ -737,8 +734,7 @@ pub fn list_dir(p: &Path) -> ~[~str] { fn star(p: &Path) -> Path { p.push("*") } do as_utf16_p(star(p).to_str()) |path_ptr| { let mut strings = ~[]; - let wfd_ptr = malloc_raw( - rustrt::rust_list_dir_wfd_size() as uint); + let wfd_ptr = malloc_raw(rust_list_dir_wfd_size() as uint); let find_handle = FindFirstFileW( path_ptr, @@ -746,8 +742,7 @@ pub fn list_dir(p: &Path) -> ~[~str] { if find_handle as int != INVALID_HANDLE_VALUE { let mut more_files = 1 as libc::c_int; while more_files != 0 { - let fp_buf = rustrt::rust_list_dir_wfd_fp_buf( - wfd_ptr); + let fp_buf = rust_list_dir_wfd_fp_buf(wfd_ptr); if fp_buf as uint == 0 { fail!(~"os::list_dir() failure:"+ ~" got null ptr from wfd"); |
