Remove remaining nolink usages.(fixes #12810)

This commit is contained in:
lpy 2014-03-11 21:39:26 +08:00 committed by Alex Crichton
parent 9959188d0e
commit aac6e31763
16 changed files with 1 additions and 44 deletions

View File

@ -1472,7 +1472,6 @@ and are instead terminated by a semicolon.
~~~~ ~~~~
# use std::libc::{c_char, FILE}; # use std::libc::{c_char, FILE};
# #[nolink]
extern { extern {
fn fopen(filename: *c_char, mode: *c_char) -> *FILE; fn fopen(filename: *c_char, mode: *c_char) -> *FILE;

View File

@ -335,7 +335,6 @@ pub fn readdir(p: &CString) -> IoResult<~[Path]> {
}).map(|path| root.join(path)).collect() }).map(|path| root.join(path)).collect()
} }
#[nolink]
extern { extern {
fn rust_list_dir_wfd_size() -> libc::size_t; fn rust_list_dir_wfd_size() -> libc::size_t;
fn rust_list_dir_wfd_fp_buf(wfd: *libc::c_void) -> *u16; fn rust_list_dir_wfd_fp_buf(wfd: *libc::c_void) -> *u16;

View File

@ -979,7 +979,7 @@ static other_attrs: &'static [&'static str] = &[
"macro_export", "must_use", "macro_export", "must_use",
//mod-level //mod-level
"path", "link_name", "link_args", "nolink", "macro_escape", "no_implicit_prelude", "path", "link_name", "link_args", "macro_escape", "no_implicit_prelude",
// fn-level // fn-level
"test", "bench", "should_fail", "ignore", "inline", "lang", "main", "start", "test", "bench", "should_fail", "ignore", "inline", "lang", "main", "start",

View File

@ -150,7 +150,6 @@ mod darwin_fd_limit {
rlim_cur: rlim_t, rlim_cur: rlim_t,
rlim_max: rlim_t rlim_max: rlim_t
} }
#[nolink]
extern { extern {
// name probably doesn't need to be mut, but the C function doesn't specify const // name probably doesn't need to be mut, but the C function doesn't specify const
fn sysctl(name: *mut libc::c_int, namelen: libc::c_uint, fn sysctl(name: *mut libc::c_int, namelen: libc::c_uint,

View File

@ -3306,7 +3306,6 @@ pub mod funcs {
// or anything. The same is not true of POSIX. // or anything. The same is not true of POSIX.
pub mod c95 { pub mod c95 {
#[nolink]
pub mod ctype { pub mod ctype {
use libc::types::os::arch::c95::{c_char, c_int}; use libc::types::os::arch::c95::{c_char, c_int};
@ -3327,7 +3326,6 @@ pub mod funcs {
} }
} }
#[nolink]
pub mod stdio { pub mod stdio {
use libc::types::common::c95::{FILE, c_void, fpos_t}; use libc::types::common::c95::{FILE, c_void, fpos_t};
use libc::types::os::arch::c95::{c_char, c_int, c_long, size_t}; use libc::types::os::arch::c95::{c_char, c_int, c_long, size_t};
@ -3383,7 +3381,6 @@ pub mod funcs {
} }
} }
#[nolink]
pub mod stdlib { pub mod stdlib {
use libc::types::common::c95::c_void; use libc::types::common::c95::c_void;
use libc::types::os::arch::c95::{c_char, c_double, c_int}; use libc::types::os::arch::c95::{c_char, c_double, c_int};
@ -3416,7 +3413,6 @@ pub mod funcs {
} }
} }
#[nolink]
pub mod string { pub mod string {
use libc::types::common::c95::c_void; use libc::types::common::c95::c_void;
use libc::types::os::arch::c95::{c_char, c_int, size_t}; use libc::types::os::arch::c95::{c_char, c_int, size_t};
@ -3461,7 +3457,6 @@ pub mod funcs {
#[cfg(target_os = "win32")] #[cfg(target_os = "win32")]
pub mod posix88 { pub mod posix88 {
#[nolink]
pub mod stat_ { pub mod stat_ {
use libc::types::os::common::posix01::{stat, utimbuf}; use libc::types::os::common::posix01::{stat, utimbuf};
use libc::types::os::arch::c95::{c_int, c_char, wchar_t}; use libc::types::os::arch::c95::{c_int, c_char, wchar_t};
@ -3486,7 +3481,6 @@ pub mod funcs {
} }
} }
#[nolink]
pub mod stdio { pub mod stdio {
use libc::types::common::c95::FILE; use libc::types::common::c95::FILE;
use libc::types::os::arch::c95::{c_int, c_char}; use libc::types::os::arch::c95::{c_int, c_char};
@ -3503,7 +3497,6 @@ pub mod funcs {
} }
} }
#[nolink]
pub mod fcntl { pub mod fcntl {
use libc::types::os::arch::c95::{c_int, c_char, wchar_t}; use libc::types::os::arch::c95::{c_int, c_char, wchar_t};
extern { extern {
@ -3518,12 +3511,10 @@ pub mod funcs {
} }
} }
#[nolink]
pub mod dirent { pub mod dirent {
// Not supplied at all. // Not supplied at all.
} }
#[nolink]
pub mod unistd { pub mod unistd {
use libc::types::common::c95::c_void; use libc::types::common::c95::c_void;
use libc::types::os::arch::c95::{c_int, c_uint, c_char, use libc::types::os::arch::c95::{c_int, c_uint, c_char,
@ -3590,7 +3581,6 @@ pub mod funcs {
use libc::types::os::arch::posix01::stat; use libc::types::os::arch::posix01::stat;
use libc::types::os::arch::posix88::mode_t; use libc::types::os::arch::posix88::mode_t;
#[nolink]
extern { extern {
pub fn chmod(path: *c_char, mode: mode_t) -> c_int; pub fn chmod(path: *c_char, mode: mode_t) -> c_int;
pub fn fchmod(fd: c_int, mode: mode_t) -> c_int; pub fn fchmod(fd: c_int, mode: mode_t) -> c_int;
@ -3618,7 +3608,6 @@ pub mod funcs {
} }
} }
#[nolink]
pub mod stdio { pub mod stdio {
use libc::types::common::c95::FILE; use libc::types::common::c95::FILE;
use libc::types::os::arch::c95::{c_char, c_int}; use libc::types::os::arch::c95::{c_char, c_int};
@ -3631,7 +3620,6 @@ pub mod funcs {
} }
} }
#[nolink]
pub mod fcntl { pub mod fcntl {
use libc::types::os::arch::c95::{c_char, c_int}; use libc::types::os::arch::c95::{c_char, c_int};
use libc::types::os::arch::posix88::mode_t; use libc::types::os::arch::posix88::mode_t;
@ -3644,7 +3632,6 @@ pub mod funcs {
} }
} }
#[nolink]
pub mod dirent { pub mod dirent {
use libc::types::common::posix88::{DIR, dirent_t}; use libc::types::common::posix88::{DIR, dirent_t};
use libc::types::os::arch::c95::{c_char, c_int, c_long}; use libc::types::os::arch::c95::{c_char, c_int, c_long};
@ -3678,7 +3665,6 @@ pub mod funcs {
} }
} }
#[nolink]
pub mod unistd { pub mod unistd {
use libc::types::common::c95::c_void; use libc::types::common::c95::c_void;
use libc::types::os::arch::c95::{c_char, c_int, c_long, c_uint}; use libc::types::os::arch::c95::{c_char, c_int, c_long, c_uint};
@ -3748,7 +3734,6 @@ pub mod funcs {
} }
} }
#[nolink]
pub mod signal { pub mod signal {
use libc::types::os::arch::c95::{c_int}; use libc::types::os::arch::c95::{c_int};
use libc::types::os::arch::posix88::{pid_t}; use libc::types::os::arch::posix88::{pid_t};
@ -3758,7 +3743,6 @@ pub mod funcs {
} }
} }
#[nolink]
pub mod mman { pub mod mman {
use libc::types::common::c95::{c_void}; use libc::types::common::c95::{c_void};
use libc::types::os::arch::c95::{size_t, c_int, c_char}; use libc::types::os::arch::c95::{size_t, c_int, c_char};
@ -3796,7 +3780,6 @@ pub mod funcs {
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
#[cfg(target_os = "freebsd")] #[cfg(target_os = "freebsd")]
pub mod posix01 { pub mod posix01 {
#[nolink]
pub mod stat_ { pub mod stat_ {
use libc::types::os::arch::c95::{c_char, c_int}; use libc::types::os::arch::c95::{c_char, c_int};
use libc::types::os::arch::posix01::stat; use libc::types::os::arch::posix01::stat;
@ -3813,7 +3796,6 @@ pub mod funcs {
} }
} }
#[nolink]
pub mod unistd { pub mod unistd {
use libc::types::os::arch::c95::{c_char, c_int, size_t}; use libc::types::os::arch::c95::{c_char, c_int, size_t};
use libc::types::os::arch::posix88::{ssize_t, off_t}; use libc::types::os::arch::posix88::{ssize_t, off_t};
@ -3841,7 +3823,6 @@ pub mod funcs {
} }
} }
#[nolink]
pub mod wait { pub mod wait {
use libc::types::os::arch::c95::{c_int}; use libc::types::os::arch::c95::{c_int};
use libc::types::os::arch::posix88::{pid_t}; use libc::types::os::arch::posix88::{pid_t};
@ -3852,7 +3833,6 @@ pub mod funcs {
} }
} }
#[nolink]
pub mod glob { pub mod glob {
use libc::types::os::arch::c95::{c_char, c_int}; use libc::types::os::arch::c95::{c_char, c_int};
use libc::types::os::common::posix01::{glob_t}; use libc::types::os::common::posix01::{glob_t};
@ -3867,7 +3847,6 @@ pub mod funcs {
} }
} }
#[nolink]
pub mod mman { pub mod mman {
use libc::types::common::c95::{c_void}; use libc::types::common::c95::{c_void};
use libc::types::os::arch::c95::{c_int, size_t}; use libc::types::os::arch::c95::{c_int, size_t};
@ -4032,7 +4011,6 @@ pub mod funcs {
} }
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
#[nolink]
pub mod extra { pub mod extra {
use libc::types::os::arch::c95::{c_char, c_int}; use libc::types::os::arch::c95::{c_char, c_int};
@ -4256,7 +4234,6 @@ pub mod funcs {
use libc::types::os::arch::c95::{c_int, c_long}; use libc::types::os::arch::c95::{c_int, c_long};
use libc::types::os::arch::c99::intptr_t; use libc::types::os::arch::c99::intptr_t;
#[nolink]
extern { extern {
#[link_name = "_commit"] #[link_name = "_commit"]
pub fn commit(fd: c_int) -> c_int; pub fn commit(fd: c_int) -> c_int;

View File

@ -615,7 +615,6 @@ pub fn errno() -> int {
#[cfg(target_os = "macos")] #[cfg(target_os = "macos")]
#[cfg(target_os = "freebsd")] #[cfg(target_os = "freebsd")]
fn errno_location() -> *c_int { fn errno_location() -> *c_int {
#[nolink]
extern { extern {
fn __error() -> *c_int; fn __error() -> *c_int;
} }
@ -627,7 +626,6 @@ pub fn errno() -> int {
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
#[cfg(target_os = "android")] #[cfg(target_os = "android")]
fn errno_location() -> *c_int { fn errno_location() -> *c_int {
#[nolink]
extern { extern {
fn __errno_location() -> *c_int; fn __errno_location() -> *c_int;
} }
@ -665,7 +663,6 @@ pub fn last_os_error() -> ~str {
#[cfg(target_os = "freebsd")] #[cfg(target_os = "freebsd")]
fn strerror_r(errnum: c_int, buf: *mut c_char, buflen: libc::size_t) fn strerror_r(errnum: c_int, buf: *mut c_char, buflen: libc::size_t)
-> c_int { -> c_int {
#[nolink]
extern { extern {
fn strerror_r(errnum: c_int, buf: *mut c_char, fn strerror_r(errnum: c_int, buf: *mut c_char,
buflen: libc::size_t) -> c_int; buflen: libc::size_t) -> c_int;
@ -681,7 +678,6 @@ pub fn last_os_error() -> ~str {
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
fn strerror_r(errnum: c_int, buf: *mut c_char, fn strerror_r(errnum: c_int, buf: *mut c_char,
buflen: libc::size_t) -> c_int { buflen: libc::size_t) -> c_int {
#[nolink]
extern { extern {
fn __xpg_strerror_r(errnum: c_int, fn __xpg_strerror_r(errnum: c_int,
buf: *mut c_char, buf: *mut c_char,

View File

@ -14,7 +14,6 @@
use std::libc; use std::libc;
#[nolink]
extern { extern {
static mut rust_dbg_static_mut: libc::c_int; static mut rust_dbg_static_mut: libc::c_int;
pub fn rust_dbg_static_mut_check_four(); pub fn rust_dbg_static_mut_check_four();

View File

@ -12,7 +12,6 @@
use std::libc; use std::libc;
#[nolink]
extern { extern {
pub fn bare_type1(size: int); //~ ERROR: found rust type pub fn bare_type1(size: int); //~ ERROR: found rust type
pub fn bare_type2(size: uint); //~ ERROR: found rust type pub fn bare_type2(size: uint); //~ ERROR: found rust type

View File

@ -17,7 +17,6 @@ the compiler output. */
#[feature(link_args)]; #[feature(link_args)];
#[link_args = "aFdEfSeVEEE"] #[link_args = "aFdEfSeVEEE"]
#[nolink]
extern {} extern {}
fn main() { } fn main() { }

View File

@ -11,7 +11,6 @@
mod libc { mod libc {
use std::libc::{c_char, c_long, c_longlong}; use std::libc::{c_char, c_long, c_longlong};
#[nolink]
extern { extern {
pub fn atol(x: *c_char) -> c_long; pub fn atol(x: *c_char) -> c_long;
pub fn atoll(x: *c_char) -> c_longlong; pub fn atoll(x: *c_char) -> c_longlong;

View File

@ -13,7 +13,6 @@ extern crate extra;
mod libc { mod libc {
use std::libc::{c_char, size_t}; use std::libc::{c_char, size_t};
#[nolink]
extern { extern {
#[link_name = "strlen"] #[link_name = "strlen"]
pub fn my_strlen(str: *c_char) -> size_t; pub fn my_strlen(str: *c_char) -> size_t;

View File

@ -11,7 +11,6 @@
mod foo { mod foo {
use std::libc::c_int; use std::libc::c_int;
#[nolink]
extern { extern {
pub static errno: c_int; pub static errno: c_int;
} }

View File

@ -15,7 +15,6 @@ pub enum void { }
mod bindgen { mod bindgen {
use super::void; use super::void;
#[nolink]
extern { extern {
pub fn printf(v: void); pub fn printf(v: void);
} }

View File

@ -9,26 +9,22 @@
// except according to those terms. // except according to those terms.
mod bar { mod bar {
#[nolink]
extern {} extern {}
} }
mod zed { mod zed {
#[nolink]
extern {} extern {}
} }
mod libc { mod libc {
use std::libc::{c_int, c_void, size_t, ssize_t}; use std::libc::{c_int, c_void, size_t, ssize_t};
#[nolink]
extern { extern {
pub fn write(fd: c_int, buf: *c_void, count: size_t) -> ssize_t; pub fn write(fd: c_int, buf: *c_void, count: size_t) -> ssize_t;
} }
} }
mod baz { mod baz {
#[nolink]
extern {} extern {}
} }

View File

@ -10,7 +10,6 @@
// Issue #901 // Issue #901
mod libc { mod libc {
#[nolink]
extern { extern {
pub fn printf(x: ()); pub fn printf(x: ());
} }

View File

@ -13,7 +13,6 @@
#[allow(ctypes)]; #[allow(ctypes)];
mod libc { mod libc {
#[nolink]
extern { extern {
pub fn malloc(size: int) -> *u8; pub fn malloc(size: int) -> *u8;
} }