librustc: Remove pub extern
and priv extern
from the language.
Place `pub` or `priv` on individual items instead.
This commit is contained in:
parent
bb8ca1f52c
commit
06594ed96b
@ -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: *());
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@ use std::str;
|
||||
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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -251,9 +251,9 @@ impl<T: Rand + 'static> Rand for @T {
|
||||
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 tests {
|
||||
#[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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -643,9 +643,9 @@ fn spawn_process_os(prog: &str, args: &[~str],
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,39 +30,39 @@ pub type rust_task = libc::c_void;
|
||||
#[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 @@ pub trait TyVisitor {
|
||||
}
|
||||
|
||||
#[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 @@ impl ParserObsoleteMethods for Parser {
|
||||
"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::{ObsoletePurity, ObsoleteStaticMethod};
|
||||
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 @@ impl Parser {
|
||||
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 @@ use std::libc;
|
||||
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 @@ use std::task;
|
||||
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 @@ use std::task;
|
||||
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 @@ use std::str;
|
||||
mod libc {
|
||||
#[abi = "cdecl"]
|
||||
#[nolink]
|
||||
pub extern {
|
||||
extern {
|
||||
pub fn atol(x: *u8) -> int;
|
||||
pub fn atoll(x: *u8) -> i64;
|
||||
}
|
||||
|
@ -22,14 +22,14 @@ static b: bool = true;
|
||||
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 test_in_fn_ctxt() {
|
||||
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 @@ use std::libc;
|
||||
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 @@ use std::task;
|
||||
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 @@ use std::task;
|
||||
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 @@ use std::libc;
|
||||
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 @@ use std::task;
|
||||
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 @@ use std::task;
|
||||
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 @@ use std::vec;
|
||||
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 @@ extern mod extra;
|
||||
|
||||
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 @@ use std::f64;
|
||||
|
||||
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 @@ mod test_single_attr_outer {
|
||||
pub mod rustrt {
|
||||
#[attr = "val"]
|
||||
#[abi = "cdecl"]
|
||||
pub extern {}
|
||||
extern {}
|
||||
}
|
||||
}
|
||||
|
||||
@ -61,7 +61,7 @@ mod test_multi_attr_outer {
|
||||
#[attr1 = "val"]
|
||||
#[attr2 = "val"]
|
||||
#[abi = "cdecl"]
|
||||
pub extern {}
|
||||
extern {}
|
||||
}
|
||||
|
||||
#[attr1 = "val"]
|
||||
@ -84,7 +84,7 @@ mod test_stmt_single_attr_outer {
|
||||
mod rustrt {
|
||||
#[attr = "val"]
|
||||
#[abi = "cdecl"]
|
||||
pub extern {
|
||||
extern {
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -111,7 +111,7 @@ mod test_stmt_multi_attr_outer {
|
||||
#[attr1 = "val"]
|
||||
#[attr2 = "val"]
|
||||
#[abi = "cdecl"]
|
||||
pub extern {
|
||||
extern {
|
||||
}
|
||||
}
|
||||
*/
|
||||
@ -170,7 +170,7 @@ mod test_foreign_items {
|
||||
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 @@ use std::task;
|
||||
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 @@ use std::sys;
|
||||
|
||||
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 @@ use std::sys;
|
||||
|
||||
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user