Skip to content

fixing #9483, Remove #[abi = "foo"] attributes from codebase. #9601

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix i#9483, Remove #[abi = "foo"] attributes from codebase.
  • Loading branch information
wakandan committed Sep 29, 2013
commit 1dc18b8a49f26e1f906a5d972f53cc2a67e0b8a1
3 changes: 1 addition & 2 deletions src/libstd/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,8 @@ pub type fd_t = c_int;
pub mod rustrt {
use libc;

#[abi = "cdecl"]
#[link_name = "rustrt"]
extern {
extern "cdecl" {
pub fn rust_get_stdin() -> *libc::FILE;
pub fn rust_get_stdout() -> *libc::FILE;
pub fn rust_get_stderr() -> *libc::FILE;
Expand Down
76 changes: 25 additions & 51 deletions src/libstd/libc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2664,11 +2664,10 @@ pub mod funcs {

pub mod c95 {
#[nolink]
#[abi = "cdecl"]
pub mod ctype {
use libc::types::os::arch::c95::{c_char, c_int};

extern {
extern "cdecl" {
pub fn isalnum(c: c_int) -> c_int;
pub fn isalpha(c: c_int) -> c_int;
pub fn iscntrl(c: c_int) -> c_int;
Expand All @@ -2686,12 +2685,11 @@ pub mod funcs {
}

#[nolink]
#[abi = "cdecl"]
pub mod stdio {
use libc::types::common::c95::{FILE, c_void, fpos_t};
use libc::types::os::arch::c95::{c_char, c_int, c_long, size_t};

extern {
extern "cdecl" {
pub fn fopen(filename: *c_char, mode: *c_char) -> *FILE;
pub fn freopen(filename: *c_char, mode: *c_char, file: *FILE)
-> *FILE;
Expand Down Expand Up @@ -2748,14 +2746,13 @@ pub mod funcs {
}

#[nolink]
#[abi = "cdecl"]
pub mod stdlib {
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_long, c_uint, c_ulong};
use libc::types::os::arch::c95::{size_t};

extern {
extern "cdecl" {
pub fn abs(i: c_int) -> c_int;
pub fn labs(i: c_long) -> c_long;
// Omitted: div, ldiv (return pub type incomplete).
Expand Down Expand Up @@ -2786,13 +2783,12 @@ pub mod funcs {
}

#[nolink]
#[abi = "cdecl"]
pub mod string {
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::{wchar_t};

extern {
extern "cdecl" {
pub fn strcpy(dst: *c_char, src: *c_char) -> *c_char;
pub fn strncpy(dst: *c_char, src: *c_char, n: size_t)
-> *c_char;
Expand Down Expand Up @@ -2836,12 +2832,11 @@ pub mod funcs {
#[cfg(target_os = "win32")]
pub mod posix88 {
#[nolink]
#[abi = "cdecl"]
pub mod stat_ {
use libc::types::os::common::posix01::stat;
use libc::types::os::arch::c95::{c_int, c_char};

extern {
extern "cdecl" {
#[link_name = "_chmod"]
pub fn chmod(path: *c_char, mode: c_int) -> c_int;
#[link_name = "_mkdir"]
Expand All @@ -2854,12 +2849,11 @@ pub mod funcs {
}

#[nolink]
#[abi = "cdecl"]
pub mod stdio {
use libc::types::common::c95::FILE;
use libc::types::os::arch::c95::{c_int, c_char};

extern {
extern "cdecl" {
#[link_name = "_popen"]
pub fn popen(command: *c_char, mode: *c_char) -> *FILE;
#[link_name = "_pclose"]
Expand All @@ -2873,10 +2867,9 @@ pub mod funcs {
}

#[nolink]
#[abi = "cdecl"]
pub mod fcntl {
use libc::types::os::arch::c95::{c_int, c_char};
extern {
extern "cdecl" {
#[link_name = "_open"]
pub fn open(path: *c_char, oflag: c_int, mode: c_int)
-> c_int;
Expand All @@ -2886,20 +2879,18 @@ pub mod funcs {
}

#[nolink]
#[abi = "cdecl"]
pub mod dirent {
// Not supplied at all.
}

#[nolink]
#[abi = "cdecl"]
pub mod unistd {
use libc::types::common::c95::c_void;
use libc::types::os::arch::c95::{c_int, c_uint, c_char,
c_long, size_t};
use libc::types::os::arch::c99::intptr_t;

extern {
extern "cdecl" {
#[link_name = "_access"]
pub fn access(path: *c_char, amode: c_int) -> c_int;
#[link_name = "_chdir"]
Expand Down Expand Up @@ -2962,8 +2953,7 @@ pub mod funcs {
use libc::types::os::arch::posix88::mode_t;

#[nolink]
#[abi = "cdecl"]
extern {
extern "cdecl" {
pub fn chmod(path: *c_char, mode: mode_t) -> c_int;
pub fn fchmod(fd: c_int, mode: mode_t) -> c_int;

Expand Down Expand Up @@ -2991,12 +2981,11 @@ pub mod funcs {
}

#[nolink]
#[abi = "cdecl"]
pub mod stdio {
use libc::types::common::c95::FILE;
use libc::types::os::arch::c95::{c_char, c_int};

extern {
extern "cdecl" {
pub fn popen(command: *c_char, mode: *c_char) -> *FILE;
pub fn pclose(stream: *FILE) -> c_int;
pub fn fdopen(fd: c_int, mode: *c_char) -> *FILE;
Expand All @@ -3005,12 +2994,11 @@ pub mod funcs {
}

#[nolink]
#[abi = "cdecl"]
pub mod fcntl {
use libc::types::os::arch::c95::{c_char, c_int};
use libc::types::os::arch::posix88::mode_t;

extern {
extern "cdecl" {
pub fn open(path: *c_char, oflag: c_int, mode: c_int)
-> c_int;
pub fn creat(path: *c_char, mode: mode_t) -> c_int;
Expand All @@ -3019,7 +3007,6 @@ pub mod funcs {
}

#[nolink]
#[abi = "cdecl"]
pub mod dirent {
use libc::types::common::posix88::{DIR, dirent_t};
use libc::types::os::arch::c95::{c_char, c_int, c_long};
Expand All @@ -3039,12 +3026,12 @@ pub mod funcs {
rust_readdir(dirp)
}

extern {
extern "cdecl" {
fn rust_opendir(dirname: *c_char) -> *DIR;
fn rust_readdir(dirp: *DIR) -> *dirent_t;
}

extern {
extern "cdecl" {
pub fn closedir(dirp: *DIR) -> c_int;
pub fn rewinddir(dirp: *DIR);
pub fn seekdir(dirp: *DIR, loc: c_long);
Expand All @@ -3053,15 +3040,14 @@ pub mod funcs {
}

#[nolink]
#[abi = "cdecl"]
pub mod unistd {
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::{size_t};
use libc::types::os::arch::posix88::{gid_t, off_t, pid_t};
use libc::types::os::arch::posix88::{ssize_t, uid_t};

extern {
extern "cdecl" {
pub fn access(path: *c_char, amode: c_int) -> c_int;
pub fn alarm(seconds: c_uint) -> c_uint;
pub fn chdir(dir: *c_char) -> c_int;
Expand Down Expand Up @@ -3115,24 +3101,22 @@ pub mod funcs {
}

#[nolink]
#[abi = "cdecl"]
pub mod signal {
use libc::types::os::arch::c95::{c_int};
use libc::types::os::arch::posix88::{pid_t};

extern {
extern "cdecl" {
pub fn kill(pid: pid_t, sig: c_int) -> c_int;
}
}

#[nolink]
#[abi = "cdecl"]
pub mod mman {
use libc::types::common::c95::{c_void};
use libc::types::os::arch::c95::{size_t, c_int, c_char};
use libc::types::os::arch::posix88::{mode_t, off_t};

extern {
extern "cdecl" {
pub fn mlock(addr: *c_void, len: size_t) -> c_int;
pub fn munlock(addr: *c_void, len: size_t) -> c_int;
pub fn mlockall(flags: c_int) -> c_int;
Expand Down Expand Up @@ -3165,12 +3149,11 @@ pub mod funcs {
#[cfg(target_os = "freebsd")]
pub mod posix01 {
#[nolink]
#[abi = "cdecl"]
pub mod stat_ {
use libc::types::os::arch::c95::{c_char, c_int};
use libc::types::os::arch::posix01::stat;

extern {
extern "cdecl" {
#[cfg(target_os = "linux")]
#[cfg(target_os = "freebsd")]
#[cfg(target_os = "android")]
Expand All @@ -3183,12 +3166,11 @@ pub mod funcs {
}

#[nolink]
#[abi = "cdecl"]
pub mod unistd {
use libc::types::os::arch::c95::{c_char, c_int, size_t};
use libc::types::os::arch::posix88::{ssize_t};

extern {
extern "cdecl" {
pub fn readlink(path: *c_char,
buf: *mut c_char,
bufsz: size_t)
Expand All @@ -3210,25 +3192,23 @@ pub mod funcs {
}

#[nolink]
#[abi = "cdecl"]
pub mod wait {
use libc::types::os::arch::c95::{c_int};
use libc::types::os::arch::posix88::{pid_t};

extern {
extern "cdecl" {
pub fn waitpid(pid: pid_t, status: *mut c_int, options: c_int)
-> pid_t;
}
}

#[nolink]
#[abi = "cdecl"]
pub mod glob {
use libc::types::os::arch::c95::{c_char, c_int};
use libc::types::os::common::posix01::{glob_t};
use option::Option;

extern {
extern "cdecl" {
pub fn glob(pattern: *c_char,
flags: c_int,
errfunc: Option<extern "C" fn(epath: *c_char, errno: int) -> int>,
Expand All @@ -3238,12 +3218,11 @@ pub mod funcs {
}

#[nolink]
#[abi = "cdecl"]
pub mod mman {
use libc::types::common::c95::{c_void};
use libc::types::os::arch::c95::{c_int, size_t};

extern {
extern "cdecl" {
pub fn posix_madvise(addr: *c_void,
len: size_t,
advice: c_int)
Expand Down Expand Up @@ -3286,8 +3265,7 @@ pub mod funcs {
use libc::types::os::arch::c95::{c_char, c_uchar, c_int, c_uint,
size_t};

#[abi = "cdecl"]
extern {
extern "cdecl" {
pub fn sysctl(name: *c_int,
namelen: c_uint,
oldp: *mut c_void,
Expand Down Expand Up @@ -3320,8 +3298,7 @@ pub mod funcs {
use libc::types::common::c95::{c_void};
use libc::types::os::arch::c95::{c_uchar, c_int, size_t};

#[abi = "cdecl"]
extern {
extern "cdecl" {
pub fn getdtablesize() -> c_int;
pub fn madvise(addr: *c_void, len: size_t, advice: c_int)
-> c_int;
Expand All @@ -3340,8 +3317,7 @@ pub mod funcs {
pub mod extra {
use libc::types::os::arch::c95::{c_char, c_int};

#[abi = "cdecl"]
extern {
extern "cdecl" {
pub fn _NSGetExecutablePath(buf: *mut c_char, bufsize: *mut u32)
-> c_int;
}
Expand Down Expand Up @@ -3373,7 +3349,6 @@ pub mod funcs {
use libc::types::os::arch::extra::{HANDLE, LPHANDLE};

#[cfg(target_arch = "x86")]
#[abi = "stdcall"]
extern "stdcall" {
pub fn GetEnvironmentVariableW(n: LPCWSTR,
v: LPWSTR,
Expand Down Expand Up @@ -3587,9 +3562,8 @@ pub mod funcs {
pub mod msvcrt {
use libc::types::os::arch::c95::{c_int, c_long};

#[abi = "cdecl"]
#[nolink]
extern {
extern "cdecl" {
#[link_name = "_commit"]
pub fn commit(fd: c_int) -> c_int;

Expand Down
6 changes: 2 additions & 4 deletions src/libstd/num/cmath.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ pub mod c_double_utils {
use libc::{c_double, c_int};

#[link_name = "m"]
#[abi = "cdecl"]
extern {
extern "cdecl" {
// Alpabetically sorted by link_name

pub fn acos(n: c_double) -> c_double;
Expand Down Expand Up @@ -107,8 +106,7 @@ pub mod c_float_utils {
use libc::{c_float, c_int};

#[link_name = "m"]
#[abi = "cdecl"]
extern {
extern "cdecl" {
// Alpabetically sorted by link_name

#[link_name="acosf"]
Expand Down
3 changes: 1 addition & 2 deletions src/libstd/rand/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,11 +237,10 @@ impl<T: Rand + 'static> Rand for @T {
fn rand<R: Rng>(rng: &mut R) -> @T { @rng.gen() }
}

#[abi = "cdecl"]
pub mod rustrt {
use libc::size_t;

extern {
extern "cdecl" {
pub fn rand_gen_seed(buf: *mut u8, sz: size_t);
}
}
Expand Down
1 change: 0 additions & 1 deletion src/libstd/rt/thread_local_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ pub unsafe fn get(key: Key) -> *mut c_void {
}

#[cfg(windows, target_arch = "x86")]
#[abi = "stdcall"]
extern "stdcall" {
fn TlsAlloc() -> DWORD;
fn TlsSetValue(dwTlsIndex: DWORD, lpTlsvalue: LPVOID) -> BOOL;
Expand Down
Loading