mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-04 01:42:54 +03:00
librustc: Remove pub extern and priv extern from the language.
Place `pub` or `priv` on individual items instead.
This commit is contained in:
+1
-1
@@ -25,7 +25,7 @@ pub mod rustrt {
|
||||
use std::unstable::intrinsics::{TyDesc};
|
||||
|
||||
#[abi = "cdecl"]
|
||||
pub extern {
|
||||
extern {
|
||||
pub unsafe fn debug_tydesc(td: *TyDesc);
|
||||
pub unsafe fn debug_opaque(td: *TyDesc, x: *());
|
||||
pub unsafe fn debug_box(td: *TyDesc, x: *());
|
||||
|
||||
+11
-11
@@ -24,18 +24,18 @@ pub mod rustrt {
|
||||
use std::libc::{c_int, c_void, size_t};
|
||||
|
||||
#[link_name = "rustrt"]
|
||||
pub extern {
|
||||
unsafe fn tdefl_compress_mem_to_heap(psrc_buf: *const c_void,
|
||||
src_buf_len: size_t,
|
||||
pout_len: *mut size_t,
|
||||
flags: c_int)
|
||||
-> *c_void;
|
||||
extern {
|
||||
pub unsafe fn tdefl_compress_mem_to_heap(psrc_buf: *const c_void,
|
||||
src_buf_len: size_t,
|
||||
pout_len: *mut size_t,
|
||||
flags: c_int)
|
||||
-> *c_void;
|
||||
|
||||
unsafe fn tinfl_decompress_mem_to_heap(psrc_buf: *const c_void,
|
||||
src_buf_len: size_t,
|
||||
pout_len: *mut size_t,
|
||||
flags: c_int)
|
||||
-> *c_void;
|
||||
pub unsafe fn tinfl_decompress_mem_to_heap(psrc_buf: *const c_void,
|
||||
src_buf_len: size_t,
|
||||
pout_len: *mut size_t,
|
||||
flags: c_int)
|
||||
-> *c_void;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -35,11 +35,11 @@ pub mod rustrt {
|
||||
use std::libc;
|
||||
|
||||
#[nolink]
|
||||
pub extern {
|
||||
unsafe fn rust_uv_current_kernel_malloc(size: libc::c_uint)
|
||||
-> *libc::c_void;
|
||||
unsafe fn rust_uv_current_kernel_free(mem: *libc::c_void);
|
||||
unsafe fn rust_uv_helper_uv_tcp_t_size() -> libc::c_uint;
|
||||
extern {
|
||||
pub unsafe fn rust_uv_current_kernel_malloc(size: libc::c_uint)
|
||||
-> *libc::c_void;
|
||||
pub unsafe fn rust_uv_current_kernel_free(mem: *libc::c_void);
|
||||
pub unsafe fn rust_uv_helper_uv_tcp_t_size() -> libc::c_uint;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@
|
||||
pub mod rustrt {
|
||||
use std::libc::{c_char, c_int};
|
||||
|
||||
pub extern {
|
||||
extern {
|
||||
pub unsafe fn linenoise(prompt: *c_char) -> *c_char;
|
||||
pub unsafe fn linenoiseHistoryAdd(line: *c_char) -> c_int;
|
||||
pub unsafe fn linenoiseHistorySetMaxLen(len: c_int) -> c_int;
|
||||
|
||||
@@ -22,7 +22,7 @@ pub mod rustrt {
|
||||
use super::Tm;
|
||||
|
||||
#[abi = "cdecl"]
|
||||
pub extern {
|
||||
extern {
|
||||
pub unsafe fn get_time(sec: &mut i64, nsec: &mut i32);
|
||||
|
||||
pub unsafe fn precise_time_ns(ns: &mut u64);
|
||||
|
||||
@@ -161,15 +161,15 @@ pub mod icu {
|
||||
pub mod libicu {
|
||||
#[link_name = "icuuc"]
|
||||
#[abi = "cdecl"]
|
||||
pub extern {
|
||||
unsafe fn u_hasBinaryProperty(c: UChar32, which: UProperty)
|
||||
-> UBool;
|
||||
unsafe fn u_isdigit(c: UChar32) -> UBool;
|
||||
unsafe fn u_islower(c: UChar32) -> UBool;
|
||||
unsafe fn u_isspace(c: UChar32) -> UBool;
|
||||
unsafe fn u_isupper(c: UChar32) -> UBool;
|
||||
unsafe fn u_tolower(c: UChar32) -> UChar32;
|
||||
unsafe fn u_toupper(c: UChar32) -> UChar32;
|
||||
extern {
|
||||
pub unsafe fn u_hasBinaryProperty(c: UChar32, which: UProperty)
|
||||
-> UBool;
|
||||
pub unsafe fn u_isdigit(c: UChar32) -> UBool;
|
||||
pub unsafe fn u_islower(c: UChar32) -> UBool;
|
||||
pub unsafe fn u_isspace(c: UChar32) -> UBool;
|
||||
pub unsafe fn u_isupper(c: UChar32) -> UBool;
|
||||
pub unsafe fn u_tolower(c: UChar32) -> UChar32;
|
||||
pub unsafe fn u_toupper(c: UChar32) -> UChar32;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -273,7 +273,7 @@ pub mod llvm {
|
||||
#[link_args = "-Lrustllvm -lrustllvm"]
|
||||
#[link_name = "rustllvm"]
|
||||
#[abi = "cdecl"]
|
||||
pub extern {
|
||||
extern {
|
||||
/* Create and destroy contexts. */
|
||||
#[fast_ffi]
|
||||
pub unsafe fn LLVMContextCreate() -> ContextRef;
|
||||
|
||||
@@ -166,7 +166,7 @@ pub mod rustrt {
|
||||
use libc::c_void;
|
||||
|
||||
#[link_name = "rustrt"]
|
||||
pub extern {
|
||||
extern {
|
||||
#[rust_stack]
|
||||
// FIXME (#4386): Unable to make following method private.
|
||||
pub unsafe fn rust_get_task() -> *c_void;
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ pub mod rustrt {
|
||||
use super::StackSegment;
|
||||
|
||||
#[link_name = "rustrt"]
|
||||
pub extern {
|
||||
extern {
|
||||
#[rust_stack]
|
||||
pub unsafe fn rust_gc_metadata() -> *Word;
|
||||
|
||||
|
||||
+4
-4
@@ -77,10 +77,10 @@ pub mod rustrt {
|
||||
|
||||
#[abi = "cdecl"]
|
||||
#[link_name = "rustrt"]
|
||||
pub extern {
|
||||
unsafe fn rust_get_stdin() -> *libc::FILE;
|
||||
unsafe fn rust_get_stdout() -> *libc::FILE;
|
||||
unsafe fn rust_get_stderr() -> *libc::FILE;
|
||||
extern {
|
||||
pub unsafe fn rust_get_stdin() -> *libc::FILE;
|
||||
pub unsafe fn rust_get_stdout() -> *libc::FILE;
|
||||
pub unsafe fn rust_get_stderr() -> *libc::FILE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+439
-365
@@ -2292,20 +2292,20 @@ pub mod c95 {
|
||||
pub mod ctype {
|
||||
use libc::types::os::arch::c95::{c_char, c_int};
|
||||
|
||||
pub extern {
|
||||
unsafe fn isalnum(c: c_int) -> c_int;
|
||||
unsafe fn isalpha(c: c_int) -> c_int;
|
||||
unsafe fn iscntrl(c: c_int) -> c_int;
|
||||
unsafe fn isdigit(c: c_int) -> c_int;
|
||||
unsafe fn isgraph(c: c_int) -> c_int;
|
||||
unsafe fn islower(c: c_int) -> c_int;
|
||||
unsafe fn isprint(c: c_int) -> c_int;
|
||||
unsafe fn ispunct(c: c_int) -> c_int;
|
||||
unsafe fn isspace(c: c_int) -> c_int;
|
||||
unsafe fn isupper(c: c_int) -> c_int;
|
||||
unsafe fn isxdigit(c: c_int) -> c_int;
|
||||
unsafe fn tolower(c: c_char) -> c_char;
|
||||
unsafe fn toupper(c: c_char) -> c_char;
|
||||
extern {
|
||||
pub unsafe fn isalnum(c: c_int) -> c_int;
|
||||
pub unsafe fn isalpha(c: c_int) -> c_int;
|
||||
pub unsafe fn iscntrl(c: c_int) -> c_int;
|
||||
pub unsafe fn isdigit(c: c_int) -> c_int;
|
||||
pub unsafe fn isgraph(c: c_int) -> c_int;
|
||||
pub unsafe fn islower(c: c_int) -> c_int;
|
||||
pub unsafe fn isprint(c: c_int) -> c_int;
|
||||
pub unsafe fn ispunct(c: c_int) -> c_int;
|
||||
pub unsafe fn isspace(c: c_int) -> c_int;
|
||||
pub unsafe fn isupper(c: c_int) -> c_int;
|
||||
pub unsafe fn isxdigit(c: c_int) -> c_int;
|
||||
pub unsafe fn tolower(c: c_char) -> c_char;
|
||||
pub unsafe fn toupper(c: c_char) -> c_char;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2315,50 +2315,67 @@ 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};
|
||||
|
||||
pub extern {
|
||||
unsafe fn fopen(filename: *c_char, mode: *c_char) -> *FILE;
|
||||
unsafe fn freopen(filename: *c_char, mode: *c_char,
|
||||
file: *FILE) -> *FILE;
|
||||
unsafe fn fflush(file: *FILE) -> c_int;
|
||||
unsafe fn fclose(file: *FILE) -> c_int;
|
||||
unsafe fn remove(filename: *c_char) -> c_int;
|
||||
unsafe fn rename(oldname: *c_char, newname: *c_char) -> c_int;
|
||||
unsafe fn tmpfile() -> *FILE;
|
||||
unsafe fn setvbuf(stream: *FILE, buffer: *c_char,
|
||||
mode: c_int, size: size_t) -> c_int;
|
||||
unsafe fn setbuf(stream: *FILE, buf: *c_char);
|
||||
extern {
|
||||
pub unsafe fn fopen(filename: *c_char, mode: *c_char)
|
||||
-> *FILE;
|
||||
pub unsafe fn freopen(filename: *c_char,
|
||||
mode: *c_char,
|
||||
file: *FILE)
|
||||
-> *FILE;
|
||||
pub unsafe fn fflush(file: *FILE) -> c_int;
|
||||
pub unsafe fn fclose(file: *FILE) -> c_int;
|
||||
pub unsafe fn remove(filename: *c_char) -> c_int;
|
||||
pub unsafe fn rename(oldname: *c_char, newname: *c_char)
|
||||
-> c_int;
|
||||
pub unsafe fn tmpfile() -> *FILE;
|
||||
pub unsafe fn setvbuf(stream: *FILE,
|
||||
buffer: *c_char,
|
||||
mode: c_int,
|
||||
size: size_t)
|
||||
-> c_int;
|
||||
pub unsafe fn setbuf(stream: *FILE, buf: *c_char);
|
||||
// Omitted: printf and scanf variants.
|
||||
unsafe fn fgetc(stream: *FILE) -> c_int;
|
||||
pub unsafe fn fgetc(stream: *FILE) -> c_int;
|
||||
#[fast_ffi]
|
||||
unsafe fn fgets(buf: *mut c_char, n: c_int,
|
||||
stream: *FILE) -> *c_char;
|
||||
pub unsafe fn fgets(buf: *mut c_char,
|
||||
n: c_int,
|
||||
stream: *FILE)
|
||||
-> *c_char;
|
||||
#[fast_ffi]
|
||||
unsafe fn fputc(c: c_int, stream: *FILE) -> c_int;
|
||||
pub unsafe fn fputc(c: c_int, stream: *FILE) -> c_int;
|
||||
#[fast_ffi]
|
||||
unsafe fn fputs(s: *c_char, stream: *FILE) -> *c_char;
|
||||
pub unsafe fn fputs(s: *c_char, stream: *FILE) -> *c_char;
|
||||
// Omitted: getc, getchar (might be macros).
|
||||
|
||||
// Omitted: gets, so ridiculously unsafe that it should not
|
||||
// survive.
|
||||
|
||||
// Omitted: putc, putchar (might be macros).
|
||||
unsafe fn puts(s: *c_char) -> c_int;
|
||||
unsafe fn ungetc(c: c_int, stream: *FILE) -> c_int;
|
||||
pub unsafe fn puts(s: *c_char) -> c_int;
|
||||
pub unsafe fn ungetc(c: c_int, stream: *FILE) -> c_int;
|
||||
#[fast_ffi]
|
||||
unsafe fn fread(ptr: *mut c_void, size: size_t,
|
||||
nobj: size_t, stream: *FILE) -> size_t;
|
||||
pub unsafe fn fread(ptr: *mut c_void,
|
||||
size: size_t,
|
||||
nobj: size_t,
|
||||
stream: *FILE)
|
||||
-> size_t;
|
||||
#[fast_ffi]
|
||||
unsafe fn fwrite(ptr: *c_void, size: size_t,
|
||||
nobj: size_t, stream: *FILE) -> size_t;
|
||||
unsafe fn fseek(stream: *FILE, offset: c_long,
|
||||
whence: c_int) -> c_int;
|
||||
unsafe fn ftell(stream: *FILE) -> c_long;
|
||||
unsafe fn rewind(stream: *FILE);
|
||||
unsafe fn fgetpos(stream: *FILE, ptr: *fpos_t) -> c_int;
|
||||
unsafe fn fsetpos(stream: *FILE, ptr: *fpos_t) -> c_int;
|
||||
unsafe fn feof(stream: *FILE) -> c_int;
|
||||
unsafe fn ferror(stream: *FILE) -> c_int;
|
||||
unsafe fn perror(s: *c_char);
|
||||
pub unsafe fn fwrite(ptr: *c_void,
|
||||
size: size_t,
|
||||
nobj: size_t,
|
||||
stream: *FILE)
|
||||
-> size_t;
|
||||
pub unsafe fn fseek(stream: *FILE,
|
||||
offset: c_long,
|
||||
whence: c_int)
|
||||
-> c_int;
|
||||
pub unsafe fn ftell(stream: *FILE) -> c_long;
|
||||
pub unsafe fn rewind(stream: *FILE);
|
||||
pub unsafe fn fgetpos(stream: *FILE, ptr: *fpos_t) -> c_int;
|
||||
pub unsafe fn fsetpos(stream: *FILE, ptr: *fpos_t) -> c_int;
|
||||
pub unsafe fn feof(stream: *FILE) -> c_int;
|
||||
pub unsafe fn ferror(stream: *FILE) -> c_int;
|
||||
pub unsafe fn perror(s: *c_char);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2370,33 +2387,34 @@ pub mod stdlib {
|
||||
use libc::types::os::arch::c95::{c_long, c_uint, c_ulong};
|
||||
use libc::types::os::arch::c95::{size_t};
|
||||
|
||||
pub extern {
|
||||
unsafe fn abs(i: c_int) -> c_int;
|
||||
unsafe fn labs(i: c_long) -> c_long;
|
||||
extern {
|
||||
pub unsafe fn abs(i: c_int) -> c_int;
|
||||
pub unsafe fn labs(i: c_long) -> c_long;
|
||||
// Omitted: div, ldiv (return pub type incomplete).
|
||||
unsafe fn atof(s: *c_char) -> c_double;
|
||||
unsafe fn atoi(s: *c_char) -> c_int;
|
||||
unsafe fn strtod(s: *c_char, endp: **c_char) -> c_double;
|
||||
unsafe fn strtol(s: *c_char, endp: **c_char, base: c_int)
|
||||
-> c_long;
|
||||
unsafe fn strtoul(s: *c_char, endp: **c_char, base: c_int)
|
||||
-> c_ulong;
|
||||
pub unsafe fn atof(s: *c_char) -> c_double;
|
||||
pub unsafe fn atoi(s: *c_char) -> c_int;
|
||||
pub unsafe fn strtod(s: *c_char, endp: **c_char) -> c_double;
|
||||
pub unsafe fn strtol(s: *c_char, endp: **c_char, base: c_int)
|
||||
-> c_long;
|
||||
pub unsafe fn strtoul(s: *c_char, endp: **c_char, base: c_int)
|
||||
-> c_ulong;
|
||||
#[fast_ffi]
|
||||
unsafe fn calloc(nobj: size_t, size: size_t) -> *c_void;
|
||||
pub unsafe fn calloc(nobj: size_t, size: size_t) -> *c_void;
|
||||
#[fast_ffi]
|
||||
unsafe fn malloc(size: size_t) -> *c_void;
|
||||
pub unsafe fn malloc(size: size_t) -> *c_void;
|
||||
#[fast_ffi]
|
||||
unsafe fn realloc(p: *mut c_void, size: size_t) -> *mut c_void;
|
||||
pub unsafe fn realloc(p: *mut c_void, size: size_t)
|
||||
-> *mut c_void;
|
||||
#[fast_ffi]
|
||||
unsafe fn free(p: *c_void);
|
||||
unsafe fn abort() -> !;
|
||||
unsafe fn exit(status: c_int) -> !;
|
||||
pub unsafe fn free(p: *c_void);
|
||||
pub unsafe fn abort() -> !;
|
||||
pub unsafe fn exit(status: c_int) -> !;
|
||||
// Omitted: atexit.
|
||||
unsafe fn system(s: *c_char) -> c_int;
|
||||
unsafe fn getenv(s: *c_char) -> *c_char;
|
||||
pub unsafe fn system(s: *c_char) -> c_int;
|
||||
pub unsafe fn getenv(s: *c_char) -> *c_char;
|
||||
// Omitted: bsearch, qsort
|
||||
unsafe fn rand() -> c_int;
|
||||
unsafe fn srand(seed: c_uint);
|
||||
pub unsafe fn rand() -> c_int;
|
||||
pub unsafe fn srand(seed: c_uint);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2407,29 +2425,29 @@ pub mod string {
|
||||
use libc::types::os::arch::c95::{c_char, c_int, size_t};
|
||||
use libc::types::os::arch::c95::{wchar_t};
|
||||
|
||||
pub extern {
|
||||
unsafe fn strcpy(dst: *c_char, src: *c_char) -> *c_char;
|
||||
unsafe fn strncpy(dst: *c_char, src: *c_char, n: size_t)
|
||||
-> *c_char;
|
||||
unsafe fn strcat(s: *c_char, ct: *c_char) -> *c_char;
|
||||
unsafe fn strncat(s: *c_char, ct: *c_char, n: size_t)
|
||||
-> *c_char;
|
||||
unsafe fn strcmp(cs: *c_char, ct: *c_char) -> c_int;
|
||||
unsafe fn strncmp(cs: *c_char, ct: *c_char, n: size_t)
|
||||
-> c_int;
|
||||
unsafe fn strcoll(cs: *c_char, ct: *c_char) -> c_int;
|
||||
unsafe fn strchr(cs: *c_char, c: c_int) -> *c_char;
|
||||
unsafe fn strrchr(cs: *c_char, c: c_int) -> *c_char;
|
||||
unsafe fn strspn(cs: *c_char, ct: *c_char) -> size_t;
|
||||
unsafe fn strcspn(cs: *c_char, ct: *c_char) -> size_t;
|
||||
unsafe fn strpbrk(cs: *c_char, ct: *c_char) -> *c_char;
|
||||
unsafe fn strstr(cs: *c_char, ct: *c_char) -> *c_char;
|
||||
unsafe fn strlen(cs: *c_char) -> size_t;
|
||||
unsafe fn strerror(n: c_int) -> *c_char;
|
||||
unsafe fn strtok(s: *c_char, t: *c_char) -> *c_char;
|
||||
unsafe fn strxfrm(s: *c_char, ct: *c_char, n: size_t)
|
||||
-> size_t;
|
||||
unsafe fn wcslen(buf: *wchar_t) -> size_t;
|
||||
extern {
|
||||
pub unsafe fn strcpy(dst: *c_char, src: *c_char) -> *c_char;
|
||||
pub unsafe fn strncpy(dst: *c_char, src: *c_char, n: size_t)
|
||||
-> *c_char;
|
||||
pub unsafe fn strcat(s: *c_char, ct: *c_char) -> *c_char;
|
||||
pub unsafe fn strncat(s: *c_char, ct: *c_char, n: size_t)
|
||||
-> *c_char;
|
||||
pub unsafe fn strcmp(cs: *c_char, ct: *c_char) -> c_int;
|
||||
pub unsafe fn strncmp(cs: *c_char, ct: *c_char, n: size_t)
|
||||
-> c_int;
|
||||
pub unsafe fn strcoll(cs: *c_char, ct: *c_char) -> c_int;
|
||||
pub unsafe fn strchr(cs: *c_char, c: c_int) -> *c_char;
|
||||
pub unsafe fn strrchr(cs: *c_char, c: c_int) -> *c_char;
|
||||
pub unsafe fn strspn(cs: *c_char, ct: *c_char) -> size_t;
|
||||
pub unsafe fn strcspn(cs: *c_char, ct: *c_char) -> size_t;
|
||||
pub unsafe fn strpbrk(cs: *c_char, ct: *c_char) -> *c_char;
|
||||
pub unsafe fn strstr(cs: *c_char, ct: *c_char) -> *c_char;
|
||||
pub unsafe fn strlen(cs: *c_char) -> size_t;
|
||||
pub unsafe fn strerror(n: c_int) -> *c_char;
|
||||
pub unsafe fn strtok(s: *c_char, t: *c_char) -> *c_char;
|
||||
pub unsafe fn strxfrm(s: *c_char, ct: *c_char, n: size_t)
|
||||
-> size_t;
|
||||
pub unsafe fn wcslen(buf: *wchar_t) -> size_t;
|
||||
|
||||
// Omitted: memcpy, memmove, memset (provided by LLVM)
|
||||
|
||||
@@ -2437,11 +2455,12 @@ unsafe fn strxfrm(s: *c_char, ct: *c_char, n: size_t)
|
||||
// in fact, because LLVM generates calls to them!
|
||||
#[rust_stack]
|
||||
#[inline]
|
||||
unsafe fn memcmp(cx: *c_void, ct: *c_void, n: size_t)
|
||||
-> c_int;
|
||||
pub unsafe fn memcmp(cx: *c_void, ct: *c_void, n: size_t)
|
||||
-> c_int;
|
||||
#[rust_stack]
|
||||
#[inline]
|
||||
unsafe fn memchr(cx: *c_void, c: c_int, n: size_t) -> *c_void;
|
||||
pub unsafe fn memchr(cx: *c_void, c: c_int, n: size_t)
|
||||
-> *c_void;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2460,18 +2479,18 @@ pub mod stat_ {
|
||||
use libc::types::os::common::posix01::stat;
|
||||
use libc::types::os::arch::c95::{c_int, c_char};
|
||||
|
||||
pub extern {
|
||||
extern {
|
||||
#[link_name = "_chmod"]
|
||||
unsafe fn chmod(path: *c_char, mode: c_int) -> c_int;
|
||||
pub unsafe fn chmod(path: *c_char, mode: c_int) -> c_int;
|
||||
|
||||
#[link_name = "_mkdir"]
|
||||
unsafe fn mkdir(path: *c_char) -> c_int;
|
||||
pub unsafe fn mkdir(path: *c_char) -> c_int;
|
||||
|
||||
#[link_name = "_fstat64"]
|
||||
unsafe fn fstat(fildes: c_int, buf: *mut stat) -> c_int;
|
||||
pub unsafe fn fstat(fildes: c_int, buf: *mut stat) -> c_int;
|
||||
|
||||
#[link_name = "_stat64"]
|
||||
unsafe fn stat(path: *c_char, buf: *mut stat) -> c_int;
|
||||
pub unsafe fn stat(path: *c_char, buf: *mut stat) -> c_int;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2481,19 +2500,19 @@ pub mod stdio {
|
||||
use libc::types::common::c95::FILE;
|
||||
use libc::types::os::arch::c95::{c_int, c_char};
|
||||
|
||||
pub extern {
|
||||
extern {
|
||||
#[link_name = "_popen"]
|
||||
unsafe fn popen(command: *c_char, mode: *c_char) -> *FILE;
|
||||
pub unsafe fn popen(command: *c_char, mode: *c_char) -> *FILE;
|
||||
|
||||
#[link_name = "_pclose"]
|
||||
unsafe fn pclose(stream: *FILE) -> c_int;
|
||||
pub unsafe fn pclose(stream: *FILE) -> c_int;
|
||||
|
||||
#[link_name = "_fdopen"]
|
||||
#[fast_ffi]
|
||||
unsafe fn fdopen(fd: c_int, mode: *c_char) -> *FILE;
|
||||
pub unsafe fn fdopen(fd: c_int, mode: *c_char) -> *FILE;
|
||||
|
||||
#[link_name = "_fileno"]
|
||||
unsafe fn fileno(stream: *FILE) -> c_int;
|
||||
pub unsafe fn fileno(stream: *FILE) -> c_int;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2501,13 +2520,13 @@ pub mod stdio {
|
||||
#[abi = "cdecl"]
|
||||
pub mod fcntl {
|
||||
use libc::types::os::arch::c95::{c_int, c_char};
|
||||
pub extern {
|
||||
extern {
|
||||
#[link_name = "_open"]
|
||||
unsafe fn open(path: *c_char, oflag: c_int, mode: c_int)
|
||||
-> c_int;
|
||||
pub unsafe fn open(path: *c_char, oflag: c_int, mode: c_int)
|
||||
-> c_int;
|
||||
|
||||
#[link_name = "_creat"]
|
||||
unsafe fn creat(path: *c_char, mode: c_int) -> c_int;
|
||||
pub unsafe fn creat(path: *c_char, mode: c_int) -> c_int;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2525,68 +2544,75 @@ pub mod unistd {
|
||||
c_long, size_t};
|
||||
use libc::types::os::arch::c99::intptr_t;
|
||||
|
||||
pub extern {
|
||||
extern {
|
||||
#[link_name = "_access"]
|
||||
unsafe fn access(path: *c_char, amode: c_int) -> c_int;
|
||||
pub unsafe fn access(path: *c_char, amode: c_int) -> c_int;
|
||||
|
||||
#[link_name = "_chdir"]
|
||||
unsafe fn chdir(dir: *c_char) -> c_int;
|
||||
pub unsafe fn chdir(dir: *c_char) -> c_int;
|
||||
|
||||
#[link_name = "_close"]
|
||||
unsafe fn close(fd: c_int) -> c_int;
|
||||
pub unsafe fn close(fd: c_int) -> c_int;
|
||||
|
||||
#[link_name = "_dup"]
|
||||
unsafe fn dup(fd: c_int) -> c_int;
|
||||
pub unsafe fn dup(fd: c_int) -> c_int;
|
||||
|
||||
#[link_name = "_dup2"]
|
||||
unsafe fn dup2(src: c_int, dst: c_int) -> c_int;
|
||||
pub unsafe fn dup2(src: c_int, dst: c_int) -> c_int;
|
||||
|
||||
#[link_name = "_execv"]
|
||||
unsafe fn execv(prog: *c_char, argv: **c_char) -> intptr_t;
|
||||
pub unsafe fn execv(prog: *c_char, argv: **c_char)
|
||||
-> intptr_t;
|
||||
|
||||
#[link_name = "_execve"]
|
||||
unsafe fn execve(prog: *c_char, argv: **c_char,
|
||||
envp: **c_char) -> c_int;
|
||||
pub unsafe fn execve(prog: *c_char,
|
||||
argv: **c_char,
|
||||
envp: **c_char)
|
||||
-> c_int;
|
||||
|
||||
#[link_name = "_execvp"]
|
||||
unsafe fn execvp(c: *c_char, argv: **c_char) -> c_int;
|
||||
pub unsafe fn execvp(c: *c_char, argv: **c_char) -> c_int;
|
||||
|
||||
#[link_name = "_execvpe"]
|
||||
unsafe fn execvpe(c: *c_char, argv: **c_char,
|
||||
envp: **c_char) -> c_int;
|
||||
pub unsafe fn execvpe(c: *c_char,
|
||||
argv: **c_char,
|
||||
envp: **c_char)
|
||||
-> c_int;
|
||||
|
||||
#[link_name = "_getcwd"]
|
||||
unsafe fn getcwd(buf: *c_char, size: size_t) -> *c_char;
|
||||
pub unsafe fn getcwd(buf: *c_char, size: size_t) -> *c_char;
|
||||
|
||||
#[link_name = "_getpid"]
|
||||
unsafe fn getpid() -> c_int;
|
||||
pub unsafe fn getpid() -> c_int;
|
||||
|
||||
#[link_name = "_isatty"]
|
||||
unsafe fn isatty(fd: c_int) -> c_int;
|
||||
pub unsafe fn isatty(fd: c_int) -> c_int;
|
||||
|
||||
#[link_name = "_lseek"]
|
||||
unsafe fn lseek(fd: c_int, offset: c_long, origin: c_int)
|
||||
-> c_long;
|
||||
pub unsafe fn lseek(fd: c_int, offset: c_long, origin: c_int)
|
||||
-> c_long;
|
||||
|
||||
#[link_name = "_pipe"]
|
||||
unsafe fn pipe(fds: *mut c_int, psize: c_uint,
|
||||
textmode: c_int) -> c_int;
|
||||
pub unsafe fn pipe(fds: *mut c_int,
|
||||
psize: c_uint,
|
||||
textmode: c_int)
|
||||
-> c_int;
|
||||
|
||||
#[link_name = "_read"]
|
||||
#[fast_ffi]
|
||||
unsafe fn read(fd: c_int, buf: *mut c_void, count: c_uint)
|
||||
-> c_int;
|
||||
pub unsafe fn read(fd: c_int, buf: *mut c_void, count: c_uint)
|
||||
-> c_int;
|
||||
|
||||
#[link_name = "_rmdir"]
|
||||
unsafe fn rmdir(path: *c_char) -> c_int;
|
||||
pub unsafe fn rmdir(path: *c_char) -> c_int;
|
||||
|
||||
#[link_name = "_unlink"]
|
||||
unsafe fn unlink(c: *c_char) -> c_int;
|
||||
pub unsafe fn unlink(c: *c_char) -> c_int;
|
||||
|
||||
#[link_name = "_write"]
|
||||
#[fast_ffi]
|
||||
unsafe fn write(fd: c_int, buf: *c_void, count: c_uint)
|
||||
-> c_int;
|
||||
pub unsafe fn write(fd: c_int, buf: *c_void, count: c_uint)
|
||||
-> c_int;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2607,30 +2633,30 @@ pub mod stat_ {
|
||||
|
||||
#[nolink]
|
||||
#[abi = "cdecl"]
|
||||
pub extern {
|
||||
unsafe fn chmod(path: *c_char, mode: mode_t) -> c_int;
|
||||
unsafe fn fchmod(fd: c_int, mode: mode_t) -> c_int;
|
||||
extern {
|
||||
pub unsafe fn chmod(path: *c_char, mode: mode_t) -> c_int;
|
||||
pub unsafe fn fchmod(fd: c_int, mode: mode_t) -> c_int;
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
#[cfg(target_os = "freebsd")]
|
||||
#[cfg(target_os = "android")]
|
||||
unsafe fn fstat(fildes: c_int, buf: *mut stat) -> c_int;
|
||||
pub unsafe fn fstat(fildes: c_int, buf: *mut stat) -> c_int;
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
#[link_name = "fstat64"]
|
||||
unsafe fn fstat(fildes: c_int, buf: *mut stat) -> c_int;
|
||||
pub unsafe fn fstat(fildes: c_int, buf: *mut stat) -> c_int;
|
||||
|
||||
unsafe fn mkdir(path: *c_char, mode: mode_t) -> c_int;
|
||||
unsafe fn mkfifo(path: *c_char, mode: mode_t) -> c_int;
|
||||
pub unsafe fn mkdir(path: *c_char, mode: mode_t) -> c_int;
|
||||
pub unsafe fn mkfifo(path: *c_char, mode: mode_t) -> c_int;
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
#[cfg(target_os = "freebsd")]
|
||||
#[cfg(target_os = "android")]
|
||||
unsafe fn stat(path: *c_char, buf: *mut stat) -> c_int;
|
||||
pub unsafe fn stat(path: *c_char, buf: *mut stat) -> c_int;
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
#[link_name = "stat64"]
|
||||
unsafe fn stat(path: *c_char, buf: *mut stat) -> c_int;
|
||||
pub unsafe fn stat(path: *c_char, buf: *mut stat) -> c_int;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2640,11 +2666,11 @@ pub mod stdio {
|
||||
use libc::types::common::c95::FILE;
|
||||
use libc::types::os::arch::c95::{c_char, c_int};
|
||||
|
||||
pub extern {
|
||||
unsafe fn popen(command: *c_char, mode: *c_char) -> *FILE;
|
||||
unsafe fn pclose(stream: *FILE) -> c_int;
|
||||
unsafe fn fdopen(fd: c_int, mode: *c_char) -> *FILE;
|
||||
unsafe fn fileno(stream: *FILE) -> c_int;
|
||||
extern {
|
||||
pub unsafe fn popen(command: *c_char, mode: *c_char) -> *FILE;
|
||||
pub unsafe fn pclose(stream: *FILE) -> c_int;
|
||||
pub unsafe fn fdopen(fd: c_int, mode: *c_char) -> *FILE;
|
||||
pub unsafe fn fileno(stream: *FILE) -> c_int;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2654,11 +2680,11 @@ pub mod fcntl {
|
||||
use libc::types::os::arch::c95::{c_char, c_int};
|
||||
use libc::types::os::arch::posix88::mode_t;
|
||||
|
||||
pub extern {
|
||||
unsafe fn open(path: *c_char, oflag: c_int, mode: c_int)
|
||||
-> c_int;
|
||||
unsafe fn creat(path: *c_char, mode: mode_t) -> c_int;
|
||||
unsafe fn fcntl(fd: c_int, cmd: c_int) -> c_int;
|
||||
extern {
|
||||
pub unsafe fn open(path: *c_char, oflag: c_int, mode: c_int)
|
||||
-> c_int;
|
||||
pub unsafe fn creat(path: *c_char, mode: mode_t) -> c_int;
|
||||
pub unsafe fn fcntl(fd: c_int, cmd: c_int) -> c_int;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2686,11 +2712,11 @@ pub unsafe fn readdir(dirp: *DIR) -> *dirent_t {
|
||||
unsafe fn rust_readdir(dirp: *DIR) -> *dirent_t;
|
||||
}
|
||||
|
||||
pub extern {
|
||||
unsafe fn closedir(dirp: *DIR) -> c_int;
|
||||
unsafe fn rewinddir(dirp: *DIR);
|
||||
unsafe fn seekdir(dirp: *DIR, loc: c_long);
|
||||
unsafe fn telldir(dirp: *DIR) -> c_long;
|
||||
extern {
|
||||
pub unsafe fn closedir(dirp: *DIR) -> c_int;
|
||||
pub unsafe fn rewinddir(dirp: *DIR);
|
||||
pub unsafe fn seekdir(dirp: *DIR, loc: c_long);
|
||||
pub unsafe fn telldir(dirp: *DIR) -> c_long;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2703,59 +2729,63 @@ pub mod unistd {
|
||||
use libc::types::os::arch::posix88::{gid_t, off_t, pid_t};
|
||||
use libc::types::os::arch::posix88::{ssize_t, uid_t};
|
||||
|
||||
pub extern {
|
||||
unsafe fn access(path: *c_char, amode: c_int) -> c_int;
|
||||
unsafe fn alarm(seconds: c_uint) -> c_uint;
|
||||
unsafe fn chdir(dir: *c_char) -> c_int;
|
||||
unsafe fn chown(path: *c_char, uid: uid_t, gid: gid_t)
|
||||
-> c_int;
|
||||
unsafe fn close(fd: c_int) -> c_int;
|
||||
unsafe fn dup(fd: c_int) -> c_int;
|
||||
unsafe fn dup2(src: c_int, dst: c_int) -> c_int;
|
||||
unsafe fn execv(prog: *c_char, argv: **c_char) -> c_int;
|
||||
unsafe fn execve(prog: *c_char,
|
||||
argv: **c_char,
|
||||
envp: **c_char)
|
||||
-> c_int;
|
||||
unsafe fn execvp(c: *c_char, argv: **c_char) -> c_int;
|
||||
unsafe fn fork() -> pid_t;
|
||||
unsafe fn fpathconf(filedes: c_int, name: c_int) -> c_long;
|
||||
unsafe fn getcwd(buf: *c_char, size: size_t) -> *c_char;
|
||||
unsafe fn getegid() -> gid_t;
|
||||
unsafe fn geteuid() -> uid_t;
|
||||
unsafe fn getgid() -> gid_t ;
|
||||
unsafe fn getgroups(ngroups_max: c_int, groups: *mut gid_t)
|
||||
-> c_int;
|
||||
unsafe fn getlogin() -> *c_char;
|
||||
unsafe fn getopt(argc: c_int, argv: **c_char, optstr: *c_char)
|
||||
-> c_int;
|
||||
unsafe fn getpgrp() -> pid_t;
|
||||
unsafe fn getpid() -> pid_t;
|
||||
unsafe fn getppid() -> pid_t;
|
||||
unsafe fn getuid() -> uid_t;
|
||||
unsafe fn isatty(fd: c_int) -> c_int;
|
||||
unsafe fn link(src: *c_char, dst: *c_char) -> c_int;
|
||||
unsafe fn lseek(fd: c_int, offset: off_t, whence: c_int)
|
||||
-> off_t;
|
||||
unsafe fn pathconf(path: *c_char, name: c_int) -> c_long;
|
||||
unsafe fn pause() -> c_int;
|
||||
unsafe fn pipe(fds: *mut c_int) -> c_int;
|
||||
extern {
|
||||
pub unsafe fn access(path: *c_char, amode: c_int) -> c_int;
|
||||
pub unsafe fn alarm(seconds: c_uint) -> c_uint;
|
||||
pub unsafe fn chdir(dir: *c_char) -> c_int;
|
||||
pub unsafe fn chown(path: *c_char, uid: uid_t, gid: gid_t)
|
||||
-> c_int;
|
||||
pub unsafe fn close(fd: c_int) -> c_int;
|
||||
pub unsafe fn dup(fd: c_int) -> c_int;
|
||||
pub unsafe fn dup2(src: c_int, dst: c_int) -> c_int;
|
||||
pub unsafe fn execv(prog: *c_char, argv: **c_char) -> c_int;
|
||||
pub unsafe fn execve(prog: *c_char,
|
||||
argv: **c_char,
|
||||
envp: **c_char)
|
||||
-> c_int;
|
||||
pub unsafe fn execvp(c: *c_char, argv: **c_char) -> c_int;
|
||||
pub unsafe fn fork() -> pid_t;
|
||||
pub unsafe fn fpathconf(filedes: c_int, name: c_int)
|
||||
-> c_long;
|
||||
pub unsafe fn getcwd(buf: *c_char, size: size_t) -> *c_char;
|
||||
pub unsafe fn getegid() -> gid_t;
|
||||
pub unsafe fn geteuid() -> uid_t;
|
||||
pub unsafe fn getgid() -> gid_t ;
|
||||
pub unsafe fn getgroups(ngroups_max: c_int,
|
||||
groups: *mut gid_t)
|
||||
-> c_int;
|
||||
pub unsafe fn getlogin() -> *c_char;
|
||||
pub unsafe fn getopt(argc: c_int,
|
||||
argv: **c_char,
|
||||
optstr: *c_char)
|
||||
-> c_int;
|
||||
pub unsafe fn getpgrp() -> pid_t;
|
||||
pub unsafe fn getpid() -> pid_t;
|
||||
pub unsafe fn getppid() -> pid_t;
|
||||
pub unsafe fn getuid() -> uid_t;
|
||||
pub unsafe fn isatty(fd: c_int) -> c_int;
|
||||
pub unsafe fn link(src: *c_char, dst: *c_char) -> c_int;
|
||||
pub unsafe fn lseek(fd: c_int, offset: off_t, whence: c_int)
|
||||
-> off_t;
|
||||
pub unsafe fn pathconf(path: *c_char, name: c_int) -> c_long;
|
||||
pub unsafe fn pause() -> c_int;
|
||||
pub unsafe fn pipe(fds: *mut c_int) -> c_int;
|
||||
#[fast_ffi]
|
||||
unsafe fn read(fd: c_int, buf: *mut c_void,
|
||||
count: size_t) -> ssize_t;
|
||||
unsafe fn rmdir(path: *c_char) -> c_int;
|
||||
unsafe fn setgid(gid: gid_t) -> c_int;
|
||||
unsafe fn setpgid(pid: pid_t, pgid: pid_t) -> c_int;
|
||||
unsafe fn setsid() -> pid_t;
|
||||
unsafe fn setuid(uid: uid_t) -> c_int;
|
||||
unsafe fn sleep(secs: c_uint) -> c_uint;
|
||||
unsafe fn sysconf(name: c_int) -> c_long;
|
||||
unsafe fn tcgetpgrp(fd: c_int) -> pid_t;
|
||||
unsafe fn ttyname(fd: c_int) -> *c_char;
|
||||
unsafe fn unlink(c: *c_char) -> c_int;
|
||||
pub unsafe fn read(fd: c_int, buf: *mut c_void, count: size_t)
|
||||
-> ssize_t;
|
||||
pub unsafe fn rmdir(path: *c_char) -> c_int;
|
||||
pub unsafe fn setgid(gid: gid_t) -> c_int;
|
||||
pub unsafe fn setpgid(pid: pid_t, pgid: pid_t) -> c_int;
|
||||
pub unsafe fn setsid() -> pid_t;
|
||||
pub unsafe fn setuid(uid: uid_t) -> c_int;
|
||||
pub unsafe fn sleep(secs: c_uint) -> c_uint;
|
||||
pub unsafe fn sysconf(name: c_int) -> c_long;
|
||||
pub unsafe fn tcgetpgrp(fd: c_int) -> pid_t;
|
||||
pub unsafe fn ttyname(fd: c_int) -> *c_char;
|
||||
pub unsafe fn unlink(c: *c_char) -> c_int;
|
||||
#[fast_ffi]
|
||||
unsafe fn write(fd: c_int, buf: *c_void, count: size_t)
|
||||
-> ssize_t;
|
||||
pub unsafe fn write(fd: c_int, buf: *c_void, count: size_t)
|
||||
-> ssize_t;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2765,8 +2795,8 @@ pub mod signal {
|
||||
use libc::types::os::arch::c95::{c_int};
|
||||
use libc::types::os::arch::posix88::{pid_t};
|
||||
|
||||
pub extern {
|
||||
unsafe fn kill(pid: pid_t, sig: c_int) -> c_int;
|
||||
extern {
|
||||
pub unsafe fn kill(pid: pid_t, sig: c_int) -> c_int;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2777,28 +2807,33 @@ pub mod mman {
|
||||
use libc::types::os::arch::c95::{size_t, c_int, c_char};
|
||||
use libc::types::os::arch::posix88::{mode_t, off_t};
|
||||
|
||||
pub extern {
|
||||
unsafe fn mlock(addr: *c_void, len: size_t) -> c_int;
|
||||
unsafe fn munlock(addr: *c_void, len: size_t) -> c_int;
|
||||
unsafe fn mlockall(flags: c_int) -> c_int;
|
||||
unsafe fn munlockall() -> c_int;
|
||||
extern {
|
||||
pub unsafe fn mlock(addr: *c_void, len: size_t) -> c_int;
|
||||
pub unsafe fn munlock(addr: *c_void, len: size_t) -> c_int;
|
||||
pub unsafe fn mlockall(flags: c_int) -> c_int;
|
||||
pub unsafe fn munlockall() -> c_int;
|
||||
|
||||
unsafe fn mmap(addr: *c_void,
|
||||
len: size_t,
|
||||
prot: c_int,
|
||||
flags: c_int,
|
||||
fd: c_int,
|
||||
offset: off_t) -> *mut c_void;
|
||||
unsafe fn munmap(addr: *c_void, len: size_t) -> c_int;
|
||||
pub unsafe fn mmap(addr: *c_void,
|
||||
len: size_t,
|
||||
prot: c_int,
|
||||
flags: c_int,
|
||||
fd: c_int,
|
||||
offset: off_t)
|
||||
-> *mut c_void;
|
||||
pub unsafe fn munmap(addr: *c_void, len: size_t) -> c_int;
|
||||
|
||||
unsafe fn mprotect(addr: *c_void, len: size_t, prot: c_int)
|
||||
-> c_int;
|
||||
pub unsafe fn mprotect(addr: *c_void,
|
||||
len: size_t,
|
||||
prot: c_int)
|
||||
-> c_int;
|
||||
|
||||
unsafe fn msync(addr: *c_void, len: size_t, flags: c_int)
|
||||
-> c_int;
|
||||
unsafe fn shm_open(name: *c_char, oflag: c_int, mode: mode_t)
|
||||
-> c_int;
|
||||
unsafe fn shm_unlink(name: *c_char) -> c_int;
|
||||
pub unsafe fn msync(addr: *c_void, len: size_t, flags: c_int)
|
||||
-> c_int;
|
||||
pub unsafe fn shm_open(name: *c_char,
|
||||
oflag: c_int,
|
||||
mode: mode_t)
|
||||
-> c_int;
|
||||
pub unsafe fn shm_unlink(name: *c_char) -> c_int;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2814,15 +2849,15 @@ pub mod stat_ {
|
||||
use libc::types::os::arch::c95::{c_char, c_int};
|
||||
use libc::types::os::arch::posix01::stat;
|
||||
|
||||
pub extern {
|
||||
extern {
|
||||
#[cfg(target_os = "linux")]
|
||||
#[cfg(target_os = "freebsd")]
|
||||
#[cfg(target_os = "android")]
|
||||
unsafe fn lstat(path: *c_char, buf: *mut stat) -> c_int;
|
||||
pub unsafe fn lstat(path: *c_char, buf: *mut stat) -> c_int;
|
||||
|
||||
#[cfg(target_os = "macos")]
|
||||
#[link_name = "lstat64"]
|
||||
unsafe fn lstat(path: *c_char, buf: *mut stat) -> c_int;
|
||||
pub unsafe fn lstat(path: *c_char, buf: *mut stat) -> c_int;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2832,22 +2867,27 @@ pub mod unistd {
|
||||
use libc::types::os::arch::c95::{c_char, c_int, size_t};
|
||||
use libc::types::os::arch::posix88::{ssize_t};
|
||||
|
||||
pub extern {
|
||||
unsafe fn readlink(path: *c_char, buf: *mut c_char,
|
||||
bufsz: size_t) -> ssize_t;
|
||||
extern {
|
||||
pub unsafe fn readlink(path: *c_char,
|
||||
buf: *mut c_char,
|
||||
bufsz: size_t)
|
||||
-> ssize_t;
|
||||
|
||||
unsafe fn fsync(fd: c_int) -> c_int;
|
||||
pub unsafe fn fsync(fd: c_int) -> c_int;
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
#[cfg(target_os = "android")]
|
||||
unsafe fn fdatasync(fd: c_int) -> c_int;
|
||||
pub unsafe fn fdatasync(fd: c_int) -> c_int;
|
||||
|
||||
unsafe fn setenv(name: *c_char, val: *c_char,
|
||||
overwrite: c_int) -> c_int;
|
||||
unsafe fn unsetenv(name: *c_char) -> c_int;
|
||||
unsafe fn putenv(string: *c_char) -> c_int;
|
||||
pub unsafe fn setenv(name: *c_char,
|
||||
val: *c_char,
|
||||
overwrite: c_int)
|
||||
-> c_int;
|
||||
pub unsafe fn unsetenv(name: *c_char) -> c_int;
|
||||
pub unsafe fn putenv(string: *c_char) -> c_int;
|
||||
|
||||
unsafe fn symlink(path1: *c_char, path2: *c_char) -> c_int;
|
||||
pub unsafe fn symlink(path1: *c_char, path2: *c_char)
|
||||
-> c_int;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2857,11 +2897,11 @@ pub mod wait {
|
||||
use libc::types::os::arch::c95::{c_int};
|
||||
use libc::types::os::arch::posix88::{pid_t};
|
||||
|
||||
pub extern {
|
||||
unsafe fn waitpid(pid: pid_t,
|
||||
status: *mut c_int,
|
||||
options: c_int)
|
||||
-> pid_t;
|
||||
extern {
|
||||
pub unsafe fn waitpid(pid: pid_t,
|
||||
status: *mut c_int,
|
||||
options: c_int)
|
||||
-> pid_t;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2872,11 +2912,12 @@ pub mod glob {
|
||||
use libc::types::os::arch::c95::{c_char, c_int};
|
||||
use libc::types::os::common::posix01::{glob_t};
|
||||
|
||||
pub extern {
|
||||
unsafe fn glob(pattern: *c_char, flags: c_int,
|
||||
errfunc: *c_void, // XXX callback
|
||||
pglob: *mut glob_t);
|
||||
unsafe fn globfree(pglob: *mut glob_t);
|
||||
extern {
|
||||
pub unsafe fn glob(pattern: *c_char,
|
||||
flags: c_int,
|
||||
errfunc: *c_void, // XXX callback
|
||||
pglob: *mut glob_t);
|
||||
pub unsafe fn globfree(pglob: *mut glob_t);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2886,10 +2927,11 @@ pub mod mman {
|
||||
use libc::types::common::c95::{c_void};
|
||||
use libc::types::os::arch::c95::{c_int, size_t};
|
||||
|
||||
pub extern {
|
||||
unsafe fn posix_madvise(addr: *c_void,
|
||||
len: size_t,
|
||||
advice: c_int) -> c_int;
|
||||
extern {
|
||||
pub unsafe fn posix_madvise(addr: *c_void,
|
||||
len: size_t,
|
||||
advice: c_int)
|
||||
-> c_int;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2929,25 +2971,34 @@ pub mod bsd44 {
|
||||
size_t};
|
||||
|
||||
#[abi = "cdecl"]
|
||||
pub extern {
|
||||
unsafe fn sysctl(name: *c_int, namelen: c_uint,
|
||||
oldp: *mut c_void, oldlenp: *mut size_t,
|
||||
newp: *c_void, newlen: size_t) -> c_int;
|
||||
extern {
|
||||
pub unsafe fn sysctl(name: *c_int,
|
||||
namelen: c_uint,
|
||||
oldp: *mut c_void,
|
||||
oldlenp: *mut size_t,
|
||||
newp: *c_void,
|
||||
newlen: size_t)
|
||||
-> c_int;
|
||||
|
||||
unsafe fn sysctlbyname(name: *c_char,
|
||||
oldp: *mut c_void, oldlenp: *mut size_t,
|
||||
newp: *c_void, newlen: size_t) -> c_int;
|
||||
pub unsafe fn sysctlbyname(name: *c_char,
|
||||
oldp: *mut c_void,
|
||||
oldlenp: *mut size_t,
|
||||
newp: *c_void,
|
||||
newlen: size_t)
|
||||
-> c_int;
|
||||
|
||||
unsafe fn sysctlnametomib(name: *c_char, mibp: *mut c_int,
|
||||
sizep: *mut size_t) -> c_int;
|
||||
pub unsafe fn sysctlnametomib(name: *c_char,
|
||||
mibp: *mut c_int,
|
||||
sizep: *mut size_t)
|
||||
-> c_int;
|
||||
|
||||
unsafe fn getdtablesize() -> c_int;
|
||||
pub unsafe fn getdtablesize() -> c_int;
|
||||
|
||||
unsafe fn madvise(addr: *c_void, len: size_t, advice: c_int)
|
||||
-> c_int;
|
||||
pub unsafe fn madvise(addr: *c_void, len: size_t, advice: c_int)
|
||||
-> c_int;
|
||||
|
||||
unsafe fn mincore(addr: *c_void, len: size_t, vec: *c_uchar)
|
||||
-> c_int;
|
||||
pub unsafe fn mincore(addr: *c_void, len: size_t, vec: *c_uchar)
|
||||
-> c_int;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2959,14 +3010,14 @@ pub mod bsd44 {
|
||||
use libc::types::os::arch::c95::{c_uchar, c_int, size_t};
|
||||
|
||||
#[abi = "cdecl"]
|
||||
pub extern {
|
||||
unsafe fn getdtablesize() -> c_int;
|
||||
extern {
|
||||
pub unsafe fn getdtablesize() -> c_int;
|
||||
|
||||
unsafe fn madvise(addr: *c_void, len: size_t, advice: c_int)
|
||||
-> c_int;
|
||||
pub unsafe fn madvise(addr: *c_void, len: size_t, advice: c_int)
|
||||
-> c_int;
|
||||
|
||||
unsafe fn mincore(addr: *c_void, len: size_t, vec: *c_uchar)
|
||||
-> c_int;
|
||||
pub unsafe fn mincore(addr: *c_void, len: size_t, vec: *c_uchar)
|
||||
-> c_int;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2981,10 +3032,10 @@ pub mod extra {
|
||||
use libc::types::os::arch::c95::{c_char, c_int};
|
||||
|
||||
#[abi = "cdecl"]
|
||||
pub extern {
|
||||
unsafe fn _NSGetExecutablePath(buf: *mut c_char,
|
||||
bufsize: *mut u32)
|
||||
-> c_int;
|
||||
extern {
|
||||
pub unsafe fn _NSGetExecutablePath(buf: *mut c_char,
|
||||
bufsize: *mut u32)
|
||||
-> c_int;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3014,96 +3065,119 @@ pub mod kernel32 {
|
||||
use libc::types::os::arch::extra::{HANDLE, LPHANDLE};
|
||||
|
||||
#[abi = "stdcall"]
|
||||
pub extern "stdcall" {
|
||||
unsafe fn GetEnvironmentVariableW(n: LPCWSTR,
|
||||
v: LPWSTR,
|
||||
nsize: DWORD)
|
||||
-> DWORD;
|
||||
unsafe fn SetEnvironmentVariableW(n: LPCWSTR, v: LPCWSTR)
|
||||
-> BOOL;
|
||||
unsafe fn GetEnvironmentStringsA() -> LPTCH;
|
||||
unsafe fn FreeEnvironmentStringsA(env_ptr: LPTCH) -> BOOL;
|
||||
extern "stdcall" {
|
||||
pub unsafe fn GetEnvironmentVariableW(n: LPCWSTR,
|
||||
v: LPWSTR,
|
||||
nsize: DWORD)
|
||||
-> DWORD;
|
||||
pub unsafe fn SetEnvironmentVariableW(n: LPCWSTR, v: LPCWSTR)
|
||||
-> BOOL;
|
||||
pub unsafe fn GetEnvironmentStringsA() -> LPTCH;
|
||||
pub unsafe fn FreeEnvironmentStringsA(env_ptr: LPTCH) -> BOOL;
|
||||
|
||||
unsafe fn GetModuleFileNameW(hModule: HMODULE,
|
||||
lpFilename: LPWSTR,
|
||||
nSize: DWORD)
|
||||
-> DWORD;
|
||||
unsafe fn CreateDirectoryW(lpPathName: LPCWSTR,
|
||||
lpSecurityAttributes:
|
||||
LPSECURITY_ATTRIBUTES)
|
||||
pub unsafe fn GetModuleFileNameW(hModule: HMODULE,
|
||||
lpFilename: LPWSTR,
|
||||
nSize: DWORD)
|
||||
-> DWORD;
|
||||
pub unsafe fn CreateDirectoryW(lpPathName: LPCWSTR,
|
||||
lpSecurityAttributes:
|
||||
LPSECURITY_ATTRIBUTES)
|
||||
-> BOOL;
|
||||
pub unsafe fn CopyFileW(lpExistingFileName: LPCWSTR,
|
||||
lpNewFileName: LPCWSTR,
|
||||
bFailIfExists: BOOL)
|
||||
-> BOOL;
|
||||
unsafe fn CopyFileW(lpExistingFileName: LPCWSTR,
|
||||
lpNewFileName: LPCWSTR,
|
||||
bFailIfExists: BOOL)
|
||||
-> BOOL;
|
||||
unsafe fn DeleteFileW(lpPathName: LPCWSTR) -> BOOL;
|
||||
unsafe fn RemoveDirectoryW(lpPathName: LPCWSTR) -> BOOL;
|
||||
unsafe fn SetCurrentDirectoryW(lpPathName: LPCWSTR) -> BOOL;
|
||||
pub unsafe fn DeleteFileW(lpPathName: LPCWSTR) -> BOOL;
|
||||
pub unsafe fn RemoveDirectoryW(lpPathName: LPCWSTR) -> BOOL;
|
||||
pub unsafe fn SetCurrentDirectoryW(lpPathName: LPCWSTR)
|
||||
-> BOOL;
|
||||
|
||||
unsafe fn GetLastError() -> DWORD;
|
||||
unsafe fn FindFirstFileW(fileName: *u16,
|
||||
findFileData: HANDLE)
|
||||
-> HANDLE;
|
||||
unsafe fn FindNextFileW(findFile: HANDLE,
|
||||
findFileData: HANDLE)
|
||||
-> BOOL;
|
||||
unsafe fn FindClose(findFile: HANDLE) -> BOOL;
|
||||
unsafe fn DuplicateHandle(hSourceProcessHandle: HANDLE,
|
||||
hSourceHandle: HANDLE,
|
||||
hTargetProcessHandle: HANDLE,
|
||||
lpTargetHandle: LPHANDLE,
|
||||
dwDesiredAccess: DWORD,
|
||||
pub unsafe fn GetLastError() -> DWORD;
|
||||
pub unsafe fn FindFirstFileW(fileName: *u16,
|
||||
findFileData: HANDLE)
|
||||
-> HANDLE;
|
||||
pub unsafe fn FindNextFileW(findFile: HANDLE,
|
||||
findFileData: HANDLE)
|
||||
-> BOOL;
|
||||
pub unsafe fn FindClose(findFile: HANDLE) -> BOOL;
|
||||
pub unsafe fn DuplicateHandle(hSourceProcessHandle: HANDLE,
|
||||
hSourceHandle: HANDLE,
|
||||
hTargetProcessHandle: HANDLE,
|
||||
lpTargetHandle: LPHANDLE,
|
||||
dwDesiredAccess: DWORD,
|
||||
bInheritHandle: BOOL,
|
||||
dwOptions: DWORD)
|
||||
-> BOOL;
|
||||
pub unsafe fn CloseHandle(hObject: HANDLE) -> BOOL;
|
||||
pub unsafe fn OpenProcess(dwDesiredAccess: DWORD,
|
||||
bInheritHandle: BOOL,
|
||||
dwOptions: DWORD) -> BOOL;
|
||||
unsafe fn CloseHandle(hObject: HANDLE) -> BOOL;
|
||||
unsafe fn OpenProcess(dwDesiredAccess: DWORD,
|
||||
bInheritHandle: BOOL,
|
||||
dwProcessId: DWORD) -> HANDLE;
|
||||
unsafe fn GetCurrentProcess() -> HANDLE;
|
||||
unsafe fn CreateProcessA(lpApplicationName: LPCTSTR,
|
||||
lpCommandLine: LPTSTR,
|
||||
lpProcessAttributes: LPSECURITY_ATTRIBUTES,
|
||||
lpThreadAttributes: LPSECURITY_ATTRIBUTES,
|
||||
bInheritHandles: BOOL,
|
||||
dwCreationFlags: DWORD,
|
||||
lpEnvironment: LPVOID,
|
||||
lpCurrentDirectory: LPCTSTR,
|
||||
lpStartupInfo: LPSTARTUPINFO,
|
||||
lpProcessInformation: LPPROCESS_INFORMATION) -> BOOL;
|
||||
unsafe fn WaitForSingleObject(hHandle: HANDLE, dwMilliseconds: DWORD) -> DWORD;
|
||||
unsafe fn TerminateProcess(hProcess: HANDLE, uExitCode: c_uint) -> BOOL;
|
||||
unsafe fn GetExitCodeProcess(hProcess: HANDLE, lpExitCode: LPDWORD) -> BOOL;
|
||||
dwProcessId: DWORD)
|
||||
-> HANDLE;
|
||||
pub unsafe fn GetCurrentProcess() -> HANDLE;
|
||||
pub unsafe fn CreateProcessA(lpApplicationName: LPCTSTR,
|
||||
lpCommandLine: LPTSTR,
|
||||
lpProcessAttributes:
|
||||
LPSECURITY_ATTRIBUTES,
|
||||
lpThreadAttributes:
|
||||
LPSECURITY_ATTRIBUTES,
|
||||
bInheritHandles: BOOL,
|
||||
dwCreationFlags: DWORD,
|
||||
lpEnvironment: LPVOID,
|
||||
lpCurrentDirectory: LPCTSTR,
|
||||
lpStartupInfo: LPSTARTUPINFO,
|
||||
lpProcessInformation:
|
||||
LPPROCESS_INFORMATION)
|
||||
-> BOOL;
|
||||
pub unsafe fn WaitForSingleObject(hHandle: HANDLE,
|
||||
dwMilliseconds: DWORD)
|
||||
-> DWORD;
|
||||
pub unsafe fn TerminateProcess(hProcess: HANDLE,
|
||||
uExitCode: c_uint)
|
||||
-> BOOL;
|
||||
pub unsafe fn GetExitCodeProcess(hProcess: HANDLE,
|
||||
lpExitCode: LPDWORD)
|
||||
-> BOOL;
|
||||
|
||||
unsafe fn GetSystemInfo(lpSystemInfo: LPSYSTEM_INFO);
|
||||
unsafe fn VirtualAlloc(lpAddress: LPVOID,
|
||||
dwSize: SIZE_T,
|
||||
flAllocationType: DWORD,
|
||||
flProtect: DWORD) -> LPVOID;
|
||||
unsafe fn VirtualFree(lpAddress: LPVOID,
|
||||
dwSize: SIZE_T,
|
||||
dwFreeType: DWORD) -> BOOL;
|
||||
unsafe fn VirtualLock(lpAddress: LPVOID, dwSize: SIZE_T) -> BOOL;
|
||||
unsafe fn VirtualUnlock(lpAddress: LPVOID, dwSize: SIZE_T) -> BOOL;
|
||||
unsafe fn VirtualProtect(lpAddress: LPVOID,
|
||||
dwSize: SIZE_T,
|
||||
flNewProtect: DWORD,
|
||||
lpflOldProtect: LPDWORD) -> BOOL;
|
||||
unsafe fn VirtualQuery(lpAddress: LPCVOID,
|
||||
lpBuffer: LPMEMORY_BASIC_INFORMATION,
|
||||
dwLength: SIZE_T) -> SIZE_T;
|
||||
pub unsafe fn GetSystemInfo(lpSystemInfo: LPSYSTEM_INFO);
|
||||
pub unsafe fn VirtualAlloc(lpAddress: LPVOID,
|
||||
dwSize: SIZE_T,
|
||||
flAllocationType: DWORD,
|
||||
flProtect: DWORD)
|
||||
-> LPVOID;
|
||||
pub unsafe fn VirtualFree(lpAddress: LPVOID,
|
||||
dwSize: SIZE_T,
|
||||
dwFreeType: DWORD)
|
||||
-> BOOL;
|
||||
pub unsafe fn VirtualLock(lpAddress: LPVOID, dwSize: SIZE_T)
|
||||
-> BOOL;
|
||||
pub unsafe fn VirtualUnlock(lpAddress: LPVOID, dwSize: SIZE_T)
|
||||
-> BOOL;
|
||||
pub unsafe fn VirtualProtect(lpAddress: LPVOID,
|
||||
dwSize: SIZE_T,
|
||||
flNewProtect: DWORD,
|
||||
lpflOldProtect: LPDWORD)
|
||||
-> BOOL;
|
||||
pub unsafe fn VirtualQuery(lpAddress: LPCVOID,
|
||||
lpBuffer:
|
||||
LPMEMORY_BASIC_INFORMATION,
|
||||
dwLength: SIZE_T)
|
||||
-> SIZE_T;
|
||||
|
||||
unsafe fn CreateFileMappingW(hFile: HANDLE,
|
||||
lpAttributes: LPSECURITY_ATTRIBUTES,
|
||||
flProtect: DWORD,
|
||||
dwMaximumSizeHigh: DWORD,
|
||||
dwMaximumSizeLow: DWORD,
|
||||
lpName: LPCTSTR) -> HANDLE;
|
||||
unsafe fn MapViewOfFile(hFileMappingObject: HANDLE,
|
||||
dwDesiredAccess: DWORD,
|
||||
dwFileOffsetHigh: DWORD,
|
||||
dwFileOffsetLow: DWORD,
|
||||
dwNumberOfBytesToMap: SIZE_T) -> LPVOID;
|
||||
unsafe fn UnmapViewOfFile(lpBaseAddress: LPCVOID) -> BOOL;
|
||||
pub unsafe fn CreateFileMappingW(hFile: HANDLE,
|
||||
lpAttributes:
|
||||
LPSECURITY_ATTRIBUTES,
|
||||
flProtect: DWORD,
|
||||
dwMaximumSizeHigh: DWORD,
|
||||
dwMaximumSizeLow: DWORD,
|
||||
lpName: LPCTSTR)
|
||||
-> HANDLE;
|
||||
pub unsafe fn MapViewOfFile(hFileMappingObject: HANDLE,
|
||||
dwDesiredAccess: DWORD,
|
||||
dwFileOffsetHigh: DWORD,
|
||||
dwFileOffsetLow: DWORD,
|
||||
dwNumberOfBytesToMap: SIZE_T)
|
||||
-> LPVOID;
|
||||
pub unsafe fn UnmapViewOfFile(lpBaseAddress: LPCVOID) -> BOOL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3112,12 +3186,12 @@ pub mod msvcrt {
|
||||
|
||||
#[abi = "cdecl"]
|
||||
#[nolink]
|
||||
pub extern {
|
||||
extern {
|
||||
#[link_name = "_commit"]
|
||||
unsafe fn commit(fd: c_int) -> c_int;
|
||||
pub unsafe fn commit(fd: c_int) -> c_int;
|
||||
|
||||
#[link_name = "_get_osfhandle"]
|
||||
unsafe fn get_osfhandle(fd: c_int) -> c_long;
|
||||
pub unsafe fn get_osfhandle(fd: c_int) -> c_long;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,11 +104,11 @@ fn newsched_log_str(msg: ~str) {
|
||||
pub mod rustrt {
|
||||
use libc;
|
||||
|
||||
pub extern {
|
||||
unsafe fn rust_log_console_on();
|
||||
unsafe fn rust_log_console_off();
|
||||
unsafe fn rust_log_str(level: u32,
|
||||
string: *libc::c_char,
|
||||
size: libc::size_t);
|
||||
extern {
|
||||
pub unsafe fn rust_log_console_on();
|
||||
pub unsafe fn rust_log_console_off();
|
||||
pub unsafe fn rust_log_str(level: u32,
|
||||
string: *libc::c_char,
|
||||
size: libc::size_t);
|
||||
}
|
||||
}
|
||||
|
||||
+133
-99
@@ -19,81 +19,86 @@ pub mod c_double_utils {
|
||||
|
||||
#[link_name = "m"]
|
||||
#[abi = "cdecl"]
|
||||
pub extern {
|
||||
extern {
|
||||
// Alpabetically sorted by link_name
|
||||
|
||||
unsafe fn acos(n: c_double) -> c_double;
|
||||
unsafe fn asin(n: c_double) -> c_double;
|
||||
unsafe fn atan(n: c_double) -> c_double;
|
||||
unsafe fn atan2(a: c_double, b: c_double) -> c_double;
|
||||
unsafe fn cbrt(n: c_double) -> c_double;
|
||||
unsafe fn ceil(n: c_double) -> c_double;
|
||||
unsafe fn copysign(x: c_double, y: c_double) -> c_double;
|
||||
unsafe fn cos(n: c_double) -> c_double;
|
||||
unsafe fn cosh(n: c_double) -> c_double;
|
||||
unsafe fn erf(n: c_double) -> c_double;
|
||||
unsafe fn erfc(n: c_double) -> c_double;
|
||||
unsafe fn exp(n: c_double) -> c_double;
|
||||
pub unsafe fn acos(n: c_double) -> c_double;
|
||||
pub unsafe fn asin(n: c_double) -> c_double;
|
||||
pub unsafe fn atan(n: c_double) -> c_double;
|
||||
pub unsafe fn atan2(a: c_double, b: c_double) -> c_double;
|
||||
pub unsafe fn cbrt(n: c_double) -> c_double;
|
||||
pub unsafe fn ceil(n: c_double) -> c_double;
|
||||
pub unsafe fn copysign(x: c_double, y: c_double) -> c_double;
|
||||
pub unsafe fn cos(n: c_double) -> c_double;
|
||||
pub unsafe fn cosh(n: c_double) -> c_double;
|
||||
pub unsafe fn erf(n: c_double) -> c_double;
|
||||
pub unsafe fn erfc(n: c_double) -> c_double;
|
||||
pub unsafe fn exp(n: c_double) -> c_double;
|
||||
// rename: for consistency with underscore usage elsewhere
|
||||
#[link_name="expm1"] unsafe fn exp_m1(n: c_double) -> c_double;
|
||||
unsafe fn exp2(n: c_double) -> c_double;
|
||||
pub unsafe fn exp2(n: c_double) -> c_double;
|
||||
#[link_name="fabs"] unsafe fn abs(n: c_double) -> c_double;
|
||||
// rename: for clarity and consistency with add/sub/mul/div
|
||||
#[link_name="fdim"]
|
||||
unsafe fn abs_sub(a: c_double, b: c_double) -> c_double;
|
||||
unsafe fn floor(n: c_double) -> c_double;
|
||||
pub unsafe fn abs_sub(a: c_double, b: c_double) -> c_double;
|
||||
pub unsafe fn floor(n: c_double) -> c_double;
|
||||
// rename: for clarity and consistency with add/sub/mul/div
|
||||
#[link_name="fma"]
|
||||
unsafe fn mul_add(a: c_double, b: c_double, c: c_double) -> c_double;
|
||||
pub unsafe fn mul_add(a: c_double, b: c_double, c: c_double)
|
||||
-> c_double;
|
||||
#[link_name="fmax"]
|
||||
unsafe fn fmax(a: c_double, b: c_double) -> c_double;
|
||||
pub unsafe fn fmax(a: c_double, b: c_double) -> c_double;
|
||||
#[link_name="fmin"]
|
||||
unsafe fn fmin(a: c_double, b: c_double) -> c_double;
|
||||
pub unsafe fn fmin(a: c_double, b: c_double) -> c_double;
|
||||
#[link_name="nextafter"]
|
||||
unsafe fn next_after(x: c_double, y: c_double) -> c_double;
|
||||
unsafe fn frexp(n: c_double, value: &mut c_int) -> c_double;
|
||||
unsafe fn hypot(x: c_double, y: c_double) -> c_double;
|
||||
unsafe fn ldexp(x: c_double, n: c_int) -> c_double;
|
||||
pub unsafe fn next_after(x: c_double, y: c_double) -> c_double;
|
||||
pub unsafe fn frexp(n: c_double, value: &mut c_int) -> c_double;
|
||||
pub unsafe fn hypot(x: c_double, y: c_double) -> c_double;
|
||||
pub unsafe fn ldexp(x: c_double, n: c_int) -> c_double;
|
||||
#[cfg(unix)]
|
||||
#[link_name="lgamma_r"]
|
||||
unsafe fn lgamma(n: c_double, sign: &mut c_int) -> c_double;
|
||||
pub unsafe fn lgamma(n: c_double, sign: &mut c_int) -> c_double;
|
||||
#[cfg(windows)]
|
||||
#[link_name="__lgamma_r"]
|
||||
unsafe fn lgamma(n: c_double, sign: &mut c_int) -> c_double;
|
||||
// renamed: log is a reserved keyword; ln seems more natural, too
|
||||
#[link_name="log"] unsafe fn ln(n: c_double) -> c_double;
|
||||
pub unsafe fn lgamma(n: c_double, sign: &mut c_int) -> c_double;
|
||||
// renamed: ln seems more natural
|
||||
#[link_name="log"]
|
||||
pub unsafe fn ln(n: c_double) -> c_double;
|
||||
// renamed: "logb" /often/ is confused for log2 by beginners
|
||||
#[link_name="logb"] unsafe fn log_radix(n: c_double) -> c_double;
|
||||
#[link_name="logb"]
|
||||
pub unsafe fn log_radix(n: c_double) -> c_double;
|
||||
// renamed: to be consitent with log as ln
|
||||
#[link_name="log1p"] unsafe fn ln_1p(n: c_double) -> c_double;
|
||||
unsafe fn log10(n: c_double) -> c_double;
|
||||
unsafe fn log2(n: c_double) -> c_double;
|
||||
#[link_name="ilogb"] unsafe fn ilog_radix(n: c_double) -> c_int;
|
||||
unsafe fn modf(n: c_double, iptr: &mut c_double) -> c_double;
|
||||
unsafe fn pow(n: c_double, e: c_double) -> c_double;
|
||||
#[link_name="log1p"]
|
||||
pub unsafe fn ln_1p(n: c_double) -> c_double;
|
||||
pub unsafe fn log10(n: c_double) -> c_double;
|
||||
pub unsafe fn log2(n: c_double) -> c_double;
|
||||
#[link_name="ilogb"]
|
||||
pub unsafe fn ilog_radix(n: c_double) -> c_int;
|
||||
pub unsafe fn modf(n: c_double, iptr: &mut c_double) -> c_double;
|
||||
pub unsafe fn pow(n: c_double, e: c_double) -> c_double;
|
||||
// FIXME (#1379): enable when rounding modes become available
|
||||
// unsafe fn rint(n: c_double) -> c_double;
|
||||
unsafe fn round(n: c_double) -> c_double;
|
||||
pub unsafe fn round(n: c_double) -> c_double;
|
||||
// rename: for consistency with logradix
|
||||
#[link_name="scalbn"] unsafe fn ldexp_radix(n: c_double, i: c_int) ->
|
||||
c_double;
|
||||
unsafe fn sin(n: c_double) -> c_double;
|
||||
unsafe fn sinh(n: c_double) -> c_double;
|
||||
unsafe fn sqrt(n: c_double) -> c_double;
|
||||
unsafe fn tan(n: c_double) -> c_double;
|
||||
unsafe fn tanh(n: c_double) -> c_double;
|
||||
unsafe fn tgamma(n: c_double) -> c_double;
|
||||
unsafe fn trunc(n: c_double) -> c_double;
|
||||
#[link_name="scalbn"]
|
||||
pub unsafe fn ldexp_radix(n: c_double, i: c_int) -> c_double;
|
||||
pub unsafe fn sin(n: c_double) -> c_double;
|
||||
pub unsafe fn sinh(n: c_double) -> c_double;
|
||||
pub unsafe fn sqrt(n: c_double) -> c_double;
|
||||
pub unsafe fn tan(n: c_double) -> c_double;
|
||||
pub unsafe fn tanh(n: c_double) -> c_double;
|
||||
pub unsafe fn tgamma(n: c_double) -> c_double;
|
||||
pub unsafe fn trunc(n: c_double) -> c_double;
|
||||
|
||||
// These are commonly only available for doubles
|
||||
|
||||
unsafe fn j0(n: c_double) -> c_double;
|
||||
unsafe fn j1(n: c_double) -> c_double;
|
||||
unsafe fn jn(i: c_int, n: c_double) -> c_double;
|
||||
pub unsafe fn j0(n: c_double) -> c_double;
|
||||
pub unsafe fn j1(n: c_double) -> c_double;
|
||||
pub unsafe fn jn(i: c_int, n: c_double) -> c_double;
|
||||
|
||||
unsafe fn y0(n: c_double) -> c_double;
|
||||
unsafe fn y1(n: c_double) -> c_double;
|
||||
unsafe fn yn(i: c_int, n: c_double) -> c_double;
|
||||
pub unsafe fn y0(n: c_double) -> c_double;
|
||||
pub unsafe fn y1(n: c_double) -> c_double;
|
||||
pub unsafe fn yn(i: c_int, n: c_double) -> c_double;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,73 +107,102 @@ pub mod c_float_utils {
|
||||
|
||||
#[link_name = "m"]
|
||||
#[abi = "cdecl"]
|
||||
pub extern {
|
||||
extern {
|
||||
// Alpabetically sorted by link_name
|
||||
|
||||
#[link_name="acosf"] unsafe fn acos(n: c_float) -> c_float;
|
||||
#[link_name="asinf"] unsafe fn asin(n: c_float) -> c_float;
|
||||
#[link_name="atanf"] unsafe fn atan(n: c_float) -> c_float;
|
||||
#[link_name="acosf"]
|
||||
pub unsafe fn acos(n: c_float) -> c_float;
|
||||
#[link_name="asinf"]
|
||||
pub unsafe fn asin(n: c_float) -> c_float;
|
||||
#[link_name="atanf"]
|
||||
pub unsafe fn atan(n: c_float) -> c_float;
|
||||
#[link_name="atan2f"]
|
||||
unsafe fn atan2(a: c_float, b: c_float) -> c_float;
|
||||
#[link_name="cbrtf"] unsafe fn cbrt(n: c_float) -> c_float;
|
||||
#[link_name="ceilf"] unsafe fn ceil(n: c_float) -> c_float;
|
||||
#[link_name="copysignf"] unsafe fn copysign(x: c_float,
|
||||
y: c_float) -> c_float;
|
||||
#[link_name="cosf"] unsafe fn cos(n: c_float) -> c_float;
|
||||
#[link_name="coshf"] unsafe fn cosh(n: c_float) -> c_float;
|
||||
#[link_name="erff"] unsafe fn erf(n: c_float) -> c_float;
|
||||
#[link_name="erfcf"] unsafe fn erfc(n: c_float) -> c_float;
|
||||
#[link_name="expf"] unsafe fn exp(n: c_float) -> c_float;
|
||||
#[link_name="expm1f"]unsafe fn exp_m1(n: c_float) -> c_float;
|
||||
#[link_name="exp2f"] unsafe fn exp2(n: c_float) -> c_float;
|
||||
#[link_name="fabsf"] unsafe fn abs(n: c_float) -> c_float;
|
||||
pub unsafe fn atan2(a: c_float, b: c_float) -> c_float;
|
||||
#[link_name="cbrtf"]
|
||||
pub unsafe fn cbrt(n: c_float) -> c_float;
|
||||
#[link_name="ceilf"]
|
||||
pub unsafe fn ceil(n: c_float) -> c_float;
|
||||
#[link_name="copysignf"]
|
||||
pub unsafe fn copysign(x: c_float, y: c_float) -> c_float;
|
||||
#[link_name="cosf"]
|
||||
pub unsafe fn cos(n: c_float) -> c_float;
|
||||
#[link_name="coshf"]
|
||||
pub unsafe fn cosh(n: c_float) -> c_float;
|
||||
#[link_name="erff"]
|
||||
pub unsafe fn erf(n: c_float) -> c_float;
|
||||
#[link_name="erfcf"]
|
||||
pub unsafe fn erfc(n: c_float) -> c_float;
|
||||
#[link_name="expf"]
|
||||
pub unsafe fn exp(n: c_float) -> c_float;
|
||||
#[link_name="expm1f"]
|
||||
pub unsafe fn exp_m1(n: c_float) -> c_float;
|
||||
#[link_name="exp2f"]
|
||||
pub unsafe fn exp2(n: c_float) -> c_float;
|
||||
#[link_name="fabsf"]
|
||||
pub unsafe fn abs(n: c_float) -> c_float;
|
||||
#[link_name="fdimf"]
|
||||
unsafe fn abs_sub(a: c_float, b: c_float) -> c_float;
|
||||
#[link_name="floorf"] unsafe fn floor(n: c_float) -> c_float;
|
||||
#[link_name="frexpf"] unsafe fn frexp(n: c_float,
|
||||
value: &mut c_int) -> c_float;
|
||||
pub unsafe fn abs_sub(a: c_float, b: c_float) -> c_float;
|
||||
#[link_name="floorf"]
|
||||
pub unsafe fn floor(n: c_float) -> c_float;
|
||||
#[link_name="frexpf"]
|
||||
pub unsafe fn frexp(n: c_float, value: &mut c_int) -> c_float;
|
||||
#[link_name="fmaf"]
|
||||
unsafe fn mul_add(a: c_float, b: c_float, c: c_float) -> c_float;
|
||||
pub unsafe fn mul_add(a: c_float, b: c_float, c: c_float) -> c_float;
|
||||
#[link_name="fmaxf"]
|
||||
unsafe fn fmax(a: c_float, b: c_float) -> c_float;
|
||||
pub unsafe fn fmax(a: c_float, b: c_float) -> c_float;
|
||||
#[link_name="fminf"]
|
||||
unsafe fn fmin(a: c_float, b: c_float) -> c_float;
|
||||
pub unsafe fn fmin(a: c_float, b: c_float) -> c_float;
|
||||
#[link_name="nextafterf"]
|
||||
unsafe fn next_after(x: c_float, y: c_float) -> c_float;
|
||||
pub unsafe fn next_after(x: c_float, y: c_float) -> c_float;
|
||||
#[link_name="hypotf"]
|
||||
unsafe fn hypot(x: c_float, y: c_float) -> c_float;
|
||||
pub unsafe fn hypot(x: c_float, y: c_float) -> c_float;
|
||||
#[link_name="ldexpf"]
|
||||
unsafe fn ldexp(x: c_float, n: c_int) -> c_float;
|
||||
pub unsafe fn ldexp(x: c_float, n: c_int) -> c_float;
|
||||
|
||||
#[cfg(unix)]
|
||||
#[link_name="lgammaf_r"] unsafe fn lgamma(n: c_float,
|
||||
sign: &mut c_int) -> c_float;
|
||||
#[link_name="lgammaf_r"]
|
||||
pub unsafe fn lgamma(n: c_float, sign: &mut c_int) -> c_float;
|
||||
|
||||
#[cfg(windows)]
|
||||
#[link_name="__lgammaf_r"]
|
||||
unsafe fn lgamma(n: c_float, sign: &mut c_int) -> c_float;
|
||||
pub unsafe fn lgamma(n: c_float, sign: &mut c_int) -> c_float;
|
||||
|
||||
#[link_name="logf"] unsafe fn ln(n: c_float) -> c_float;
|
||||
#[link_name="logbf"] unsafe fn log_radix(n: c_float) -> c_float;
|
||||
#[link_name="log1pf"] unsafe fn ln_1p(n: c_float) -> c_float;
|
||||
#[link_name="log2f"] unsafe fn log2(n: c_float) -> c_float;
|
||||
#[link_name="log10f"] unsafe fn log10(n: c_float) -> c_float;
|
||||
#[link_name="ilogbf"] unsafe fn ilog_radix(n: c_float) -> c_int;
|
||||
#[link_name="modff"] unsafe fn modf(n: c_float,
|
||||
iptr: &mut c_float) -> c_float;
|
||||
#[link_name="powf"] unsafe fn pow(n: c_float, e: c_float) -> c_float;
|
||||
#[link_name="logf"]
|
||||
pub unsafe fn ln(n: c_float) -> c_float;
|
||||
#[link_name="logbf"]
|
||||
pub unsafe fn log_radix(n: c_float) -> c_float;
|
||||
#[link_name="log1pf"]
|
||||
pub unsafe fn ln_1p(n: c_float) -> c_float;
|
||||
#[link_name="log2f"]
|
||||
pub unsafe fn log2(n: c_float) -> c_float;
|
||||
#[link_name="log10f"]
|
||||
pub unsafe fn log10(n: c_float) -> c_float;
|
||||
#[link_name="ilogbf"]
|
||||
pub unsafe fn ilog_radix(n: c_float) -> c_int;
|
||||
#[link_name="modff"]
|
||||
pub unsafe fn modf(n: c_float, iptr: &mut c_float) -> c_float;
|
||||
#[link_name="powf"]
|
||||
pub unsafe fn pow(n: c_float, e: c_float) -> c_float;
|
||||
// FIXME (#1379): enable when rounding modes become available
|
||||
// #[link_name="rintf"] unsafe fn rint(n: c_float) -> c_float;
|
||||
#[link_name="roundf"] unsafe fn round(n: c_float) -> c_float;
|
||||
#[link_name="scalbnf"] unsafe fn ldexp_radix(n: c_float, i: c_int)
|
||||
-> c_float;
|
||||
#[link_name="sinf"] unsafe fn sin(n: c_float) -> c_float;
|
||||
#[link_name="sinhf"] unsafe fn sinh(n: c_float) -> c_float;
|
||||
#[link_name="sqrtf"] unsafe fn sqrt(n: c_float) -> c_float;
|
||||
#[link_name="tanf"] unsafe fn tan(n: c_float) -> c_float;
|
||||
#[link_name="tanhf"] unsafe fn tanh(n: c_float) -> c_float;
|
||||
#[link_name="tgammaf"] unsafe fn tgamma(n: c_float) -> c_float;
|
||||
#[link_name="truncf"] unsafe fn trunc(n: c_float) -> c_float;
|
||||
#[link_name="roundf"]
|
||||
pub unsafe fn round(n: c_float) -> c_float;
|
||||
#[link_name="scalbnf"]
|
||||
pub unsafe fn ldexp_radix(n: c_float, i: c_int) -> c_float;
|
||||
#[link_name="sinf"]
|
||||
pub unsafe fn sin(n: c_float) -> c_float;
|
||||
#[link_name="sinhf"]
|
||||
pub unsafe fn sinh(n: c_float) -> c_float;
|
||||
#[link_name="sqrtf"]
|
||||
pub unsafe fn sqrt(n: c_float) -> c_float;
|
||||
#[link_name="tanf"]
|
||||
pub unsafe fn tan(n: c_float) -> c_float;
|
||||
#[link_name="tanhf"]
|
||||
pub unsafe fn tanh(n: c_float) -> c_float;
|
||||
#[link_name="tgammaf"]
|
||||
pub unsafe fn tgamma(n: c_float) -> c_float;
|
||||
#[link_name="truncf"]
|
||||
pub unsafe fn trunc(n: c_float) -> c_float;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -61,12 +61,12 @@ pub mod rustrt {
|
||||
use libc::{c_char, c_int};
|
||||
use libc;
|
||||
|
||||
pub extern {
|
||||
unsafe fn rust_get_argc() -> c_int;
|
||||
unsafe fn rust_get_argv() -> **c_char;
|
||||
unsafe fn rust_path_is_dir(path: *libc::c_char) -> c_int;
|
||||
unsafe fn rust_path_exists(path: *libc::c_char) -> c_int;
|
||||
unsafe fn rust_set_exit_status(code: libc::intptr_t);
|
||||
extern {
|
||||
pub unsafe fn rust_get_argc() -> c_int;
|
||||
pub unsafe fn rust_get_argv() -> **c_char;
|
||||
pub unsafe fn rust_path_is_dir(path: *libc::c_char) -> c_int;
|
||||
pub unsafe fn rust_path_exists(path: *libc::c_char) -> c_int;
|
||||
pub unsafe fn rust_set_exit_status(code: libc::intptr_t);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+10
-9
@@ -256,20 +256,21 @@ pub mod rustrt {
|
||||
use libc;
|
||||
use super::rust_task;
|
||||
|
||||
pub extern {
|
||||
extern {
|
||||
#[rust_stack]
|
||||
unsafe fn rust_get_task() -> *rust_task;
|
||||
pub unsafe fn rust_get_task() -> *rust_task;
|
||||
#[rust_stack]
|
||||
unsafe fn rust_task_ref(task: *rust_task);
|
||||
unsafe fn rust_task_deref(task: *rust_task);
|
||||
pub unsafe fn rust_task_ref(task: *rust_task);
|
||||
pub unsafe fn rust_task_deref(task: *rust_task);
|
||||
|
||||
#[rust_stack]
|
||||
unsafe fn task_clear_event_reject(task: *rust_task);
|
||||
pub unsafe fn task_clear_event_reject(task: *rust_task);
|
||||
|
||||
unsafe fn task_wait_event(this: *rust_task,
|
||||
killed: &mut *libc::c_void)
|
||||
-> bool;
|
||||
unsafe fn task_signal_event(target: *rust_task, event: *libc::c_void);
|
||||
pub unsafe fn task_wait_event(this: *rust_task,
|
||||
killed: &mut *libc::c_void)
|
||||
-> bool;
|
||||
pub unsafe fn task_signal_event(target: *rust_task,
|
||||
event: *libc::c_void);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+8
-7
@@ -251,9 +251,9 @@ fn rand<R: Rng>(rng: &mut R) -> @T { @rng.gen() }
|
||||
pub mod rustrt {
|
||||
use libc::size_t;
|
||||
|
||||
pub extern {
|
||||
unsafe fn rand_seed_size() -> size_t;
|
||||
unsafe fn rand_gen_seed(buf: *mut u8, sz: size_t);
|
||||
extern {
|
||||
pub unsafe fn rand_seed_size() -> size_t;
|
||||
pub unsafe fn rand_gen_seed(buf: *mut u8, sz: size_t);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1087,10 +1087,11 @@ mod rustrt {
|
||||
#[allow(non_camel_case_types)] // runtime type
|
||||
pub enum rust_rng {}
|
||||
|
||||
pub extern {
|
||||
unsafe fn rand_new_seeded(buf: *u8, sz: size_t) -> *rust_rng;
|
||||
unsafe fn rand_next(rng: *rust_rng) -> u32;
|
||||
unsafe fn rand_free(rng: *rust_rng);
|
||||
extern {
|
||||
pub unsafe fn rand_new_seeded(buf: *u8, sz: size_t)
|
||||
-> *rust_rng;
|
||||
pub unsafe fn rand_next(rng: *rust_rng) -> u32;
|
||||
pub unsafe fn rand_free(rng: *rust_rng);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -345,9 +345,9 @@ pub fn context() -> RuntimeContext {
|
||||
}
|
||||
}
|
||||
|
||||
pub extern {
|
||||
extern {
|
||||
#[rust_stack]
|
||||
fn rust_try_get_task() -> *rust_task;
|
||||
pub fn rust_try_get_task() -> *rust_task;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -643,9 +643,9 @@ mod rustrt {
|
||||
use libc::c_void;
|
||||
|
||||
#[abi = "cdecl"]
|
||||
pub extern {
|
||||
unsafe fn rust_unset_sigprocmask();
|
||||
unsafe fn rust_set_environ(envp: *c_void);
|
||||
extern {
|
||||
pub unsafe fn rust_unset_sigprocmask();
|
||||
pub unsafe fn rust_set_environ(envp: *c_void);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -30,11 +30,11 @@ pub struct Closure {
|
||||
pub mod rustrt {
|
||||
use libc::{c_char, size_t};
|
||||
|
||||
pub extern {
|
||||
extern {
|
||||
#[rust_stack]
|
||||
unsafe fn rust_upcall_fail(expr: *c_char,
|
||||
file: *c_char,
|
||||
line: size_t);
|
||||
pub unsafe fn rust_upcall_fail(expr: *c_char,
|
||||
file: *c_char,
|
||||
line: size_t);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -995,13 +995,13 @@ mod testrt {
|
||||
use libc;
|
||||
|
||||
#[nolink]
|
||||
pub extern {
|
||||
unsafe fn rust_dbg_lock_create() -> *libc::c_void;
|
||||
unsafe fn rust_dbg_lock_destroy(lock: *libc::c_void);
|
||||
unsafe fn rust_dbg_lock_lock(lock: *libc::c_void);
|
||||
unsafe fn rust_dbg_lock_unlock(lock: *libc::c_void);
|
||||
unsafe fn rust_dbg_lock_wait(lock: *libc::c_void);
|
||||
unsafe fn rust_dbg_lock_signal(lock: *libc::c_void);
|
||||
extern {
|
||||
pub unsafe fn rust_dbg_lock_create() -> *libc::c_void;
|
||||
pub unsafe fn rust_dbg_lock_destroy(lock: *libc::c_void);
|
||||
pub unsafe fn rust_dbg_lock_lock(lock: *libc::c_void);
|
||||
pub unsafe fn rust_dbg_lock_unlock(lock: *libc::c_void);
|
||||
pub unsafe fn rust_dbg_lock_wait(lock: *libc::c_void);
|
||||
pub unsafe fn rust_dbg_lock_signal(lock: *libc::c_void);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+21
-21
@@ -30,39 +30,39 @@
|
||||
#[allow(non_camel_case_types)] // runtime type
|
||||
pub type rust_closure = libc::c_void;
|
||||
|
||||
pub extern {
|
||||
extern {
|
||||
#[rust_stack]
|
||||
fn rust_task_yield(task: *rust_task) -> bool;
|
||||
pub fn rust_task_yield(task: *rust_task) -> bool;
|
||||
|
||||
fn rust_get_sched_id() -> sched_id;
|
||||
fn rust_new_sched(num_threads: libc::uintptr_t) -> sched_id;
|
||||
fn rust_sched_threads() -> libc::size_t;
|
||||
fn rust_sched_current_nonlazy_threads() -> libc::size_t;
|
||||
pub fn rust_get_sched_id() -> sched_id;
|
||||
pub fn rust_new_sched(num_threads: libc::uintptr_t) -> sched_id;
|
||||
pub fn rust_sched_threads() -> libc::size_t;
|
||||
pub fn rust_sched_current_nonlazy_threads() -> libc::size_t;
|
||||
|
||||
fn get_task_id() -> task_id;
|
||||
pub fn get_task_id() -> task_id;
|
||||
#[rust_stack]
|
||||
fn rust_get_task() -> *rust_task;
|
||||
pub fn rust_get_task() -> *rust_task;
|
||||
|
||||
fn new_task() -> *rust_task;
|
||||
fn rust_new_task_in_sched(id: sched_id) -> *rust_task;
|
||||
pub fn new_task() -> *rust_task;
|
||||
pub fn rust_new_task_in_sched(id: sched_id) -> *rust_task;
|
||||
|
||||
fn start_task(task: *rust_task, closure: *rust_closure);
|
||||
pub fn start_task(task: *rust_task, closure: *rust_closure);
|
||||
|
||||
fn rust_task_is_unwinding(task: *rust_task) -> bool;
|
||||
fn rust_osmain_sched_id() -> sched_id;
|
||||
pub fn rust_task_is_unwinding(task: *rust_task) -> bool;
|
||||
pub fn rust_osmain_sched_id() -> sched_id;
|
||||
#[rust_stack]
|
||||
fn rust_task_inhibit_kill(t: *rust_task);
|
||||
pub fn rust_task_inhibit_kill(t: *rust_task);
|
||||
#[rust_stack]
|
||||
fn rust_task_allow_kill(t: *rust_task);
|
||||
pub fn rust_task_allow_kill(t: *rust_task);
|
||||
#[rust_stack]
|
||||
fn rust_task_inhibit_yield(t: *rust_task);
|
||||
pub fn rust_task_inhibit_yield(t: *rust_task);
|
||||
#[rust_stack]
|
||||
fn rust_task_allow_yield(t: *rust_task);
|
||||
fn rust_task_kill_other(task: *rust_task);
|
||||
fn rust_task_kill_all(task: *rust_task);
|
||||
pub fn rust_task_allow_yield(t: *rust_task);
|
||||
pub fn rust_task_kill_other(task: *rust_task);
|
||||
pub fn rust_task_kill_all(task: *rust_task);
|
||||
|
||||
#[rust_stack]
|
||||
fn rust_get_task_local_data(task: *rust_task) -> *mut *libc::c_void;
|
||||
pub fn rust_get_task_local_data(task: *rust_task) -> *mut *libc::c_void;
|
||||
#[rust_stack]
|
||||
fn rust_task_local_data_atexit(task: *rust_task, cleanup_fn: *u8);
|
||||
pub fn rust_task_local_data_atexit(task: *rust_task, cleanup_fn: *u8);
|
||||
}
|
||||
|
||||
@@ -41,8 +41,8 @@ pub fn at_exit(f: ~fn()) {
|
||||
mod rustrt {
|
||||
use libc::c_void;
|
||||
|
||||
pub extern {
|
||||
fn rust_register_exit_function(runner: *c_void, f: ~~fn());
|
||||
extern {
|
||||
pub fn rust_register_exit_function(runner: *c_void, f: ~~fn());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -158,7 +158,7 @@ fn visit_leave_fn(&self, purity: uint, proto: uint,
|
||||
}
|
||||
|
||||
#[abi = "rust-intrinsic"]
|
||||
pub extern "rust-intrinsic" {
|
||||
extern "rust-intrinsic" {
|
||||
|
||||
/// Atomic compare and exchange, sequentially consistent.
|
||||
pub fn atomic_cxchg(dst: &mut int, old: int, src: int) -> int;
|
||||
|
||||
@@ -26,22 +26,23 @@ pub mod rustrt {
|
||||
use unstable::lang::rust_task;
|
||||
use libc::{c_char, uintptr_t};
|
||||
|
||||
pub extern {
|
||||
extern {
|
||||
#[rust_stack]
|
||||
unsafe fn rust_upcall_malloc(td: *c_char, size: uintptr_t) -> *c_char;
|
||||
pub unsafe fn rust_upcall_malloc(td: *c_char, size: uintptr_t)
|
||||
-> *c_char;
|
||||
|
||||
#[rust_stack]
|
||||
unsafe fn rust_upcall_free(ptr: *c_char);
|
||||
pub unsafe fn rust_upcall_free(ptr: *c_char);
|
||||
|
||||
#[fast_ffi]
|
||||
unsafe fn rust_upcall_malloc_noswitch(td: *c_char,
|
||||
size: uintptr_t)
|
||||
-> *c_char;
|
||||
pub unsafe fn rust_upcall_malloc_noswitch(td: *c_char,
|
||||
size: uintptr_t)
|
||||
-> *c_char;
|
||||
|
||||
#[rust_stack]
|
||||
fn rust_try_get_task() -> *rust_task;
|
||||
pub fn rust_try_get_task() -> *rust_task;
|
||||
|
||||
fn rust_dbg_breakpoint();
|
||||
pub fn rust_dbg_breakpoint();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -63,6 +63,7 @@ pub enum ObsoleteSyntax {
|
||||
ObsoleteNamedExternModule,
|
||||
ObsoleteMultipleLocalDecl,
|
||||
ObsoleteMutWithMultipleBindings,
|
||||
ObsoleteExternVisibility,
|
||||
}
|
||||
|
||||
impl to_bytes::IterBytes for ObsoleteSyntax {
|
||||
@@ -248,6 +249,11 @@ pub fn obsolete(&self, sp: span, kind: ObsoleteSyntax) {
|
||||
"use multiple local declarations instead of e.g. `let mut \
|
||||
(x, y) = ...`."
|
||||
),
|
||||
ObsoleteExternVisibility => (
|
||||
"`pub extern` or `priv extern`",
|
||||
"place the `pub` or `priv` on the individual external items \
|
||||
instead"
|
||||
)
|
||||
};
|
||||
|
||||
self.report(sp, kind, kind_str, desc);
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
use parse::obsolete::{ObsoleteConstItem, ObsoleteFixedLengthVectorType};
|
||||
use parse::obsolete::{ObsoleteNamedExternModule, ObsoleteMultipleLocalDecl};
|
||||
use parse::obsolete::{ObsoleteMutWithMultipleBindings};
|
||||
use parse::obsolete::{ParserObsoleteMethods};
|
||||
use parse::obsolete::{ObsoleteExternVisibility, ParserObsoleteMethods};
|
||||
use parse::token::{can_begin_expr, get_ident_interner, ident_to_str, is_ident};
|
||||
use parse::token::{is_ident_or_path};
|
||||
use parse::token::{is_plain_ident, INTERPOLATED, keywords, special_idents};
|
||||
@@ -4191,16 +4191,23 @@ fn parse_item_foreign_mod(&self,
|
||||
self.obsolete(*self.last_span, ObsoleteNamedExternModule);
|
||||
}
|
||||
|
||||
// Do not allow visibility to be specified.
|
||||
if visibility != ast::inherited {
|
||||
self.obsolete(*self.span, ObsoleteExternVisibility);
|
||||
}
|
||||
|
||||
let abis = opt_abis.get_or_default(AbiSet::C());
|
||||
|
||||
let (inner, next) = self.parse_inner_attrs_and_next();
|
||||
let m = self.parse_foreign_mod_items(sort, abis, next);
|
||||
self.expect(&token::RBRACE);
|
||||
|
||||
return iovi_item(self.mk_item(lo, self.last_span.hi, ident,
|
||||
item_foreign_mod(m), visibility,
|
||||
maybe_append(attrs,
|
||||
Some(inner))));
|
||||
return iovi_item(self.mk_item(lo,
|
||||
self.last_span.hi,
|
||||
ident,
|
||||
item_foreign_mod(m),
|
||||
public,
|
||||
maybe_append(attrs, Some(inner))));
|
||||
}
|
||||
|
||||
if opt_abis.is_some() {
|
||||
|
||||
@@ -524,7 +524,7 @@ pub fn print_item(s: @ps, item: &ast::item) {
|
||||
bclose(s, item.span);
|
||||
}
|
||||
ast::item_foreign_mod(ref nmod) => {
|
||||
head(s, visibility_qualified(item.vis, "extern"));
|
||||
head(s, "extern");
|
||||
word_nbsp(s, nmod.abis.to_str());
|
||||
match nmod.sort {
|
||||
ast::named => {
|
||||
|
||||
@@ -10,22 +10,22 @@
|
||||
|
||||
pub mod rusti {
|
||||
#[abi = "rust-intrinsic"]
|
||||
pub extern "rust-intrinsic" {
|
||||
fn atomic_cxchg(dst: &mut int, old: int, src: int) -> int;
|
||||
fn atomic_cxchg_acq(dst: &mut int, old: int, src: int) -> int;
|
||||
fn atomic_cxchg_rel(dst: &mut int, old: int, src: int) -> int;
|
||||
extern "rust-intrinsic" {
|
||||
pub fn atomic_cxchg(dst: &mut int, old: int, src: int) -> int;
|
||||
pub fn atomic_cxchg_acq(dst: &mut int, old: int, src: int) -> int;
|
||||
pub fn atomic_cxchg_rel(dst: &mut int, old: int, src: int) -> int;
|
||||
|
||||
fn atomic_xchg(dst: &mut int, src: int) -> int;
|
||||
fn atomic_xchg_acq(dst: &mut int, src: int) -> int;
|
||||
fn atomic_xchg_rel(dst: &mut int, src: int) -> int;
|
||||
pub fn atomic_xchg(dst: &mut int, src: int) -> int;
|
||||
pub fn atomic_xchg_acq(dst: &mut int, src: int) -> int;
|
||||
pub fn atomic_xchg_rel(dst: &mut int, src: int) -> int;
|
||||
|
||||
fn atomic_xadd(dst: &mut int, src: int) -> int;
|
||||
fn atomic_xadd_acq(dst: &mut int, src: int) -> int;
|
||||
fn atomic_xadd_rel(dst: &mut int, src: int) -> int;
|
||||
pub fn atomic_xadd(dst: &mut int, src: int) -> int;
|
||||
pub fn atomic_xadd_acq(dst: &mut int, src: int) -> int;
|
||||
pub fn atomic_xadd_rel(dst: &mut int, src: int) -> int;
|
||||
|
||||
fn atomic_xsub(dst: &mut int, src: int) -> int;
|
||||
fn atomic_xsub_acq(dst: &mut int, src: int) -> int;
|
||||
fn atomic_xsub_rel(dst: &mut int, src: int) -> int;
|
||||
pub fn atomic_xsub(dst: &mut int, src: int) -> int;
|
||||
pub fn atomic_xsub_acq(dst: &mut int, src: int) -> int;
|
||||
pub fn atomic_xsub_rel(dst: &mut int, src: int) -> int;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
pub mod rustrt {
|
||||
use std::libc;
|
||||
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn rust_dbg_call(cb: *u8, data: libc::uintptr_t)
|
||||
-> libc::uintptr_t;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
pub mod rustrt {
|
||||
use std::libc;
|
||||
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn rust_get_argc() -> libc::c_int;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
mod test {
|
||||
#[abi = "cdecl"]
|
||||
pub extern {
|
||||
extern {
|
||||
pub unsafe fn free();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#[deny(unused_unsafe)];
|
||||
|
||||
mod foo {
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn bar();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
//error-pattern:libc::c_int or libc::c_long should be used
|
||||
mod xx {
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn strlen(str: *u8) -> uint;
|
||||
pub fn foo(x: int, y: uint);
|
||||
}
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
mod rustrt {
|
||||
use std::libc;
|
||||
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn rust_dbg_call(cb: *u8, data: libc::uintptr_t)
|
||||
-> libc::uintptr_t;
|
||||
-> libc::uintptr_t;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
mod rustrt {
|
||||
use std::libc;
|
||||
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn rust_get_argc() -> libc::c_int;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ mod test {
|
||||
|
||||
#[abi = "cdecl"]
|
||||
#[nolink]
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn rust_get_sched_id() -> libc::intptr_t;
|
||||
pub fn get_task_id() -> libc::intptr_t;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ mod rustrt {
|
||||
use std::libc;
|
||||
|
||||
#[abi = "cdecl"]
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn get_task_id() -> libc::intptr_t;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
mod libc {
|
||||
#[abi = "cdecl"]
|
||||
#[nolink]
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn atol(x: *u8) -> int;
|
||||
pub fn atoll(x: *u8) -> i64;
|
||||
}
|
||||
|
||||
@@ -22,14 +22,14 @@
|
||||
mod rustrt {
|
||||
#[cfg(bogus)]
|
||||
#[abi = "cdecl"]
|
||||
pub extern {
|
||||
extern {
|
||||
// This symbol doesn't exist and would be a link error if this
|
||||
// module was translated
|
||||
pub fn bogus();
|
||||
}
|
||||
|
||||
#[abi = "cdecl"]
|
||||
pub extern {}
|
||||
extern {}
|
||||
}
|
||||
|
||||
#[cfg(bogus)]
|
||||
@@ -110,7 +110,7 @@ fn f() { }
|
||||
mod test_foreign_items {
|
||||
pub mod rustrt {
|
||||
#[abi = "cdecl"]
|
||||
pub extern {
|
||||
extern {
|
||||
#[cfg(bogus)]
|
||||
pub fn rust_get_stdin() -> ~str;
|
||||
pub fn rust_get_stdin() -> ~str;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
mod rustrt {
|
||||
use std::libc;
|
||||
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn rust_dbg_call(cb: *u8, data: libc::uintptr_t)
|
||||
-> libc::uintptr_t;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
mod rustrt {
|
||||
use std::libc;
|
||||
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn rust_dbg_call(cb: *u8, data: libc::uintptr_t)
|
||||
-> libc::uintptr_t;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
mod rustrt {
|
||||
use std::libc;
|
||||
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn rust_dbg_call(cb: *u8, data: libc::uintptr_t)
|
||||
-> libc::uintptr_t;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
mod rustrt {
|
||||
use std::libc;
|
||||
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn rust_dbg_call(cb: *u8, data: libc::uintptr_t)
|
||||
-> libc::uintptr_t;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ struct TwoU16s {
|
||||
one: u16, two: u16
|
||||
}
|
||||
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn rust_dbg_extern_identity_TwoU16s(v: TwoU16s) -> TwoU16s;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ struct TwoU32s {
|
||||
one: u32, two: u32
|
||||
}
|
||||
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn rust_dbg_extern_identity_TwoU32s(v: TwoU32s) -> TwoU32s;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ struct TwoU64s {
|
||||
one: u64, two: u64
|
||||
}
|
||||
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn rust_dbg_extern_identity_TwoU64s(u: TwoU64s) -> TwoU64s;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ struct TwoU64s {
|
||||
one: u64, two: u64
|
||||
}
|
||||
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn rust_dbg_extern_identity_TwoU64s(v: TwoU64s) -> TwoU64s;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ struct TwoU8s {
|
||||
one: u8, two: u8
|
||||
}
|
||||
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn rust_dbg_extern_identity_TwoU8s(v: TwoU8s) -> TwoU8s;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
// Test a function that takes/returns a u8.
|
||||
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn rust_dbg_extern_identity_u8(v: u8) -> u8;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn rust_dbg_extern_identity_double(v: f64) -> f64;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
// Test a function that takes/returns a u32.
|
||||
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn rust_dbg_extern_identity_u32(v: u32) -> u32;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
// Test a call to a function that takes/returns a u64.
|
||||
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn rust_dbg_extern_identity_u64(v: u64) -> u64;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ struct TwoU16s {
|
||||
one: u16, two: u16
|
||||
}
|
||||
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn rust_dbg_extern_return_TwoU16s() -> TwoU16s;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ struct TwoU32s {
|
||||
one: u32, two: u32
|
||||
}
|
||||
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn rust_dbg_extern_return_TwoU32s() -> TwoU32s;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ struct TwoU64s {
|
||||
one: u64, two: u64
|
||||
}
|
||||
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn rust_dbg_extern_return_TwoU64s() -> TwoU64s;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ struct TwoU8s {
|
||||
one: u8, two: u8
|
||||
}
|
||||
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn rust_dbg_extern_return_TwoU8s() -> TwoU8s;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
mod rustrt {
|
||||
use std::libc;
|
||||
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn rust_dbg_call(cb: *u8, data: libc::uintptr_t)
|
||||
-> libc::uintptr_t;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
mod rustrt {
|
||||
use std::libc;
|
||||
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn rust_dbg_call(cb: *u8, data: libc::uintptr_t)
|
||||
-> libc::uintptr_t;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ mod rustrt1 {
|
||||
|
||||
#[abi = "cdecl"]
|
||||
#[link_name = "rustrt"]
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn rust_get_argc() -> libc::c_int;
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,7 @@ mod rustrt2 {
|
||||
|
||||
#[abi = "cdecl"]
|
||||
#[link_name = "rustrt"]
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn rust_get_argc() -> libc::c_int;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
mod libc {
|
||||
#[nolink]
|
||||
#[abi = "cdecl"]
|
||||
pub extern {
|
||||
extern {
|
||||
#[link_name = "strlen"]
|
||||
pub fn my_strlen(str: *u8) -> uint;
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ mod WHATGOESHERE {
|
||||
// FIXME: I want to name a mod that would not link successfully
|
||||
// wouthout providing a -L argument to the compiler, and that
|
||||
// will also be found successfully at runtime.
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn IDONTKNOW() -> u32;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
mod foo {
|
||||
#[nolink]
|
||||
pub extern {
|
||||
extern {
|
||||
pub static errno: int;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
mod rustrt {
|
||||
use std::libc;
|
||||
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn get_task_id() -> libc::intptr_t;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ mod bindgen {
|
||||
use super::void;
|
||||
|
||||
#[nolink]
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn printf(v: void);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,28 +11,28 @@
|
||||
mod bar {
|
||||
#[abi = "cdecl"]
|
||||
#[nolink]
|
||||
pub extern {}
|
||||
extern {}
|
||||
}
|
||||
|
||||
mod zed {
|
||||
#[abi = "cdecl"]
|
||||
#[nolink]
|
||||
pub extern {}
|
||||
extern {}
|
||||
}
|
||||
|
||||
mod libc {
|
||||
#[abi = "cdecl"]
|
||||
#[nolink]
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn write(fd: int, buf: *u8, count: ::std::libc::size_t)
|
||||
-> ::std::libc::ssize_t;
|
||||
-> ::std::libc::ssize_t;
|
||||
}
|
||||
}
|
||||
|
||||
mod baz {
|
||||
#[abi = "cdecl"]
|
||||
#[nolink]
|
||||
pub extern {}
|
||||
extern {}
|
||||
}
|
||||
|
||||
pub fn main() { }
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
mod rusti {
|
||||
#[abi = "rust-intrinsic"]
|
||||
pub extern "rust-intrinsic" {
|
||||
extern "rust-intrinsic" {
|
||||
pub fn pref_align_of<T>() -> uint;
|
||||
pub fn min_align_of<T>() -> uint;
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
mod rusti {
|
||||
#[abi = "rust-intrinsic"]
|
||||
pub extern "rust-intrinsic" {
|
||||
extern "rust-intrinsic" {
|
||||
pub fn atomic_cxchg(dst: &mut int, old: int, src: int) -> int;
|
||||
pub fn atomic_cxchg_acq(dst: &mut int, old: int, src: int) -> int;
|
||||
pub fn atomic_cxchg_rel(dst: &mut int, old: int, src: int) -> int;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
mod rusti {
|
||||
#[abi = "rust-intrinsic"]
|
||||
pub extern "rust-intrinsic" {
|
||||
extern "rust-intrinsic" {
|
||||
pub fn frame_address(f: &once fn(*u8));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
mod rusti {
|
||||
#[abi = "rust-intrinsic"]
|
||||
pub extern "rust-intrinsic" {
|
||||
extern "rust-intrinsic" {
|
||||
pub fn move_val_init<T>(dst: &mut T, src: T);
|
||||
pub fn move_val<T>(dst: &mut T, src: T);
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
mod rusti {
|
||||
#[abi = "rust-intrinsic"]
|
||||
pub extern "rust-intrinsic" {
|
||||
extern "rust-intrinsic" {
|
||||
fn uninit<T>() -> T;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
mod rusti {
|
||||
#[abi = "rust-intrinsic"]
|
||||
pub extern "rust-intrinsic" {
|
||||
extern "rust-intrinsic" {
|
||||
fn ctpop8(x: i8) -> i8;
|
||||
fn ctpop16(x: i16) -> i16;
|
||||
fn ctpop32(x: i32) -> i32;
|
||||
|
||||
@@ -14,37 +14,37 @@
|
||||
|
||||
mod rusti {
|
||||
#[abi = "rust-intrinsic"]
|
||||
pub extern "rust-intrinsic" {
|
||||
fn sqrtf32(x: f32) -> f32;
|
||||
fn sqrtf64(x: f64) -> f64;
|
||||
fn powif32(a: f32, x: i32) -> f32;
|
||||
fn powif64(a: f64, x: i32) -> f64;
|
||||
fn sinf32(x: f32) -> f32;
|
||||
fn sinf64(x: f64) -> f64;
|
||||
fn cosf32(x: f32) -> f32;
|
||||
fn cosf64(x: f64) -> f64;
|
||||
fn powf32(a: f32, x: f32) -> f32;
|
||||
fn powf64(a: f64, x: f64) -> f64;
|
||||
fn expf32(x: f32) -> f32;
|
||||
fn expf64(x: f64) -> f64;
|
||||
fn exp2f32(x: f32) -> f32;
|
||||
fn exp2f64(x: f64) -> f64;
|
||||
fn logf32(x: f32) -> f32;
|
||||
fn logf64(x: f64) -> f64;
|
||||
fn log10f32(x: f32) -> f32;
|
||||
fn log10f64(x: f64) -> f64;
|
||||
fn log2f32(x: f32) -> f32;
|
||||
fn log2f64(x: f64) -> f64;
|
||||
fn fmaf32(a: f32, b: f32, c: f32) -> f32;
|
||||
fn fmaf64(a: f64, b: f64, c: f64) -> f64;
|
||||
fn fabsf32(x: f32) -> f32;
|
||||
fn fabsf64(x: f64) -> f64;
|
||||
fn floorf32(x: f32) -> f32;
|
||||
fn floorf64(x: f64) -> f64;
|
||||
fn ceilf32(x: f32) -> f32;
|
||||
fn ceilf64(x: f64) -> f64;
|
||||
fn truncf32(x: f32) -> f32;
|
||||
fn truncf64(x: f64) -> f64;
|
||||
extern "rust-intrinsic" {
|
||||
pub fn sqrtf32(x: f32) -> f32;
|
||||
pub fn sqrtf64(x: f64) -> f64;
|
||||
pub fn powif32(a: f32, x: i32) -> f32;
|
||||
pub fn powif64(a: f64, x: i32) -> f64;
|
||||
pub fn sinf32(x: f32) -> f32;
|
||||
pub fn sinf64(x: f64) -> f64;
|
||||
pub fn cosf32(x: f32) -> f32;
|
||||
pub fn cosf64(x: f64) -> f64;
|
||||
pub fn powf32(a: f32, x: f32) -> f32;
|
||||
pub fn powf64(a: f64, x: f64) -> f64;
|
||||
pub fn expf32(x: f32) -> f32;
|
||||
pub fn expf64(x: f64) -> f64;
|
||||
pub fn exp2f32(x: f32) -> f32;
|
||||
pub fn exp2f64(x: f64) -> f64;
|
||||
pub fn logf32(x: f32) -> f32;
|
||||
pub fn logf64(x: f64) -> f64;
|
||||
pub fn log10f32(x: f32) -> f32;
|
||||
pub fn log10f64(x: f64) -> f64;
|
||||
pub fn log2f32(x: f32) -> f32;
|
||||
pub fn log2f64(x: f64) -> f64;
|
||||
pub fn fmaf32(a: f32, b: f32, c: f32) -> f32;
|
||||
pub fn fmaf64(a: f64, b: f64, c: f64) -> f64;
|
||||
pub fn fabsf32(x: f32) -> f32;
|
||||
pub fn fabsf64(x: f64) -> f64;
|
||||
pub fn floorf32(x: f32) -> f32;
|
||||
pub fn floorf64(x: f64) -> f64;
|
||||
pub fn ceilf32(x: f32) -> f32;
|
||||
pub fn ceilf64(x: f64) -> f64;
|
||||
pub fn truncf32(x: f32) -> f32;
|
||||
pub fn truncf64(x: f64) -> f64;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
mod rustrt {
|
||||
use std::libc;
|
||||
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn get_task_id() -> libc::intptr_t;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ mod a {
|
||||
pub type rust_task = uint;
|
||||
pub mod rustrt {
|
||||
use super::rust_task;
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn rust_task_is_unwinding(rt: *rust_task) -> bool;
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@ mod b {
|
||||
pub type rust_task = bool;
|
||||
pub mod rustrt {
|
||||
use super::rust_task;
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn rust_task_is_unwinding(rt: *rust_task) -> bool;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ mod m {
|
||||
|
||||
#[link_name = "m"]
|
||||
#[abi = "cdecl"]
|
||||
pub extern {
|
||||
extern {
|
||||
#[cfg(unix)]
|
||||
#[link_name="lgamma_r"]
|
||||
pub fn lgamma(n: c_double, sign: &mut c_int) -> c_double;
|
||||
|
||||
@@ -40,7 +40,7 @@ pub mod mod1 {}
|
||||
pub mod rustrt {
|
||||
#[attr = "val"]
|
||||
#[abi = "cdecl"]
|
||||
pub extern {}
|
||||
extern {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ pub mod rustrt {
|
||||
#[attr1 = "val"]
|
||||
#[attr2 = "val"]
|
||||
#[abi = "cdecl"]
|
||||
pub extern {}
|
||||
extern {}
|
||||
}
|
||||
|
||||
#[attr1 = "val"]
|
||||
@@ -84,7 +84,7 @@ mod mod1 {
|
||||
mod rustrt {
|
||||
#[attr = "val"]
|
||||
#[abi = "cdecl"]
|
||||
pub extern {
|
||||
extern {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -111,7 +111,7 @@ pub mod rustrt {
|
||||
#[attr1 = "val"]
|
||||
#[attr2 = "val"]
|
||||
#[abi = "cdecl"]
|
||||
pub extern {
|
||||
extern {
|
||||
}
|
||||
}
|
||||
*/
|
||||
@@ -170,7 +170,7 @@ pub mod rustrt {
|
||||
use std::libc;
|
||||
|
||||
#[abi = "cdecl"]
|
||||
pub extern {
|
||||
extern {
|
||||
#[attr];
|
||||
|
||||
#[attr]
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
mod rusti {
|
||||
#[nolink]
|
||||
#[abi = "rust-intrinsic"]
|
||||
pub extern "rust-intrinsic" {
|
||||
extern "rust-intrinsic" {
|
||||
pub fn morestack_addr() -> *();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
mod rustrt {
|
||||
use std::libc;
|
||||
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn debug_get_stk_seg() -> *u8;
|
||||
|
||||
pub fn rust_get_sched_id() -> libc::intptr_t;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
// Issue #901
|
||||
mod libc {
|
||||
#[nolink]
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn printf(x: ());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
mod rusti {
|
||||
#[abi = "rust-intrinsic"]
|
||||
pub extern "rust-intrinsic" {
|
||||
extern "rust-intrinsic" {
|
||||
pub fn pref_align_of<T>() -> uint;
|
||||
pub fn min_align_of<T>() -> uint;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
mod rusti {
|
||||
#[abi = "rust-intrinsic"]
|
||||
pub extern "rust-intrinsic" {
|
||||
extern "rust-intrinsic" {
|
||||
pub fn pref_align_of<T>() -> uint;
|
||||
pub fn min_align_of<T>() -> uint;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ mod rustrt {
|
||||
|
||||
use std::libc;
|
||||
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn rust_new_sched(num_threads: libc::uintptr_t) -> sched_id;
|
||||
pub fn rust_get_sched_id() -> sched_id;
|
||||
pub fn rust_new_task_in_sched(id: sched_id) -> task_id;
|
||||
|
||||
@@ -15,7 +15,7 @@ mod rustrt {
|
||||
use super::{Floats, Quad};
|
||||
|
||||
#[nolink]
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn debug_abi_1(q: Quad) -> Quad;
|
||||
pub fn debug_abi_2(f: Floats) -> Floats;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
mod libc {
|
||||
#[nolink]
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn malloc(size: int) -> *u8;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ mod kernel32 {
|
||||
|
||||
#[cfg(target_os = "win32")]
|
||||
#[abi = "stdcall"]
|
||||
pub extern "stdcall" {
|
||||
extern "stdcall" {
|
||||
pub fn GetProcessHeap() -> HANDLE;
|
||||
pub fn HeapAlloc(hHeap: HANDLE, dwFlags: DWORD, dwBytes: SIZE_T)
|
||||
-> LPVOID;
|
||||
|
||||
Reference in New Issue
Block a user