diff options
| author | Brian Anderson <banderson@mozilla.com> | 2011-11-09 16:04:07 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2011-11-09 16:47:44 -0800 |
| commit | d26a96d2bbf78dcb4b5b43bf95137731ad0db286 (patch) | |
| tree | 36e66273be4a5e4f8f05e6731ee4c961d8ad85fb | |
| parent | e96342820d0075099d5e3bdf5689c64ad6625a45 (diff) | |
| download | rust-d26a96d2bbf78dcb4b5b43bf95137731ad0db286.tar.gz rust-d26a96d2bbf78dcb4b5b43bf95137731ad0db286.zip | |
Add "cdecl" as synonym for "c-stack-cdecl"
| -rw-r--r-- | src/comp/syntax/parse/parser.rs | 2 | ||||
| -rw-r--r-- | src/comp/syntax/print/pprust.rs | 2 | ||||
| -rw-r--r-- | src/test/bench/shootout-nbody.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/native-unsafe-fn-called.rs | 2 | ||||
| -rw-r--r-- | src/test/compile-fail/native-unsafe-fn.rs | 2 | ||||
| -rw-r--r-- | src/test/run-pass/bind-native.rs | 2 | ||||
| -rw-r--r-- | src/test/run-pass/binops.rs | 2 | ||||
| -rw-r--r-- | src/test/run-pass/c-stack-as-value.rs | 2 | ||||
| -rw-r--r-- | src/test/run-pass/c-stack-returning-int64.rs | 2 | ||||
| -rw-r--r-- | src/test/run-pass/conditional-compile.rs | 6 | ||||
| -rw-r--r-- | src/test/run-pass/import-from-native.rs | 2 | ||||
| -rw-r--r-- | src/test/run-pass/import-glob-1.rs | 2 | ||||
| -rw-r--r-- | src/test/run-pass/invoke-external-native.rs | 2 | ||||
| -rw-r--r-- | src/test/run-pass/item-attributes.rs | 10 | ||||
| -rw-r--r-- | src/test/run-pass/native-mod.rc | 2 | ||||
| -rw-r--r-- | src/test/run-pass/native-opaque-type.rs | 2 | ||||
| -rw-r--r-- | src/test/run-pass/native.rc | 2 | ||||
| -rw-r--r-- | src/test/run-pass/native2.rs | 10 |
18 files changed, 29 insertions, 27 deletions
diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs index 693625955f1..5ca1e46aaed 100644 --- a/src/comp/syntax/parse/parser.rs +++ b/src/comp/syntax/parse/parser.rs @@ -2010,6 +2010,8 @@ fn parse_item_native_mod(p: parser, attrs: [ast::attribute]) -> @ast::item { abi = ast::native_abi_rust_intrinsic; } else if str::eq(t, "c-stack-cdecl") { abi = ast::native_abi_cdecl; + } else if str::eq(t, "cdecl") { + abi = ast::native_abi_cdecl; } else if str::eq(t, "c-stack-stdcall") { abi = ast::native_abi_stdcall; } else if str::eq(t, "stdcall") { diff --git a/src/comp/syntax/print/pprust.rs b/src/comp/syntax/print/pprust.rs index f10d4f47516..4570b56cba9 100644 --- a/src/comp/syntax/print/pprust.rs +++ b/src/comp/syntax/print/pprust.rs @@ -405,7 +405,7 @@ fn print_item(s: ps, &&item: @ast::item) { word_nbsp(s, "\"rust-intrinsic\""); } ast::native_abi_cdecl. { - word_nbsp(s, "\"c-stack-cdecl\""); + word_nbsp(s, "\"cdecl\""); } ast::native_abi_stdcall. { word_nbsp(s, "\"stdcall\""); diff --git a/src/test/bench/shootout-nbody.rs b/src/test/bench/shootout-nbody.rs index e6f196f2869..72f127976ff 100644 --- a/src/test/bench/shootout-nbody.rs +++ b/src/test/bench/shootout-nbody.rs @@ -1,7 +1,7 @@ // based on: // http://shootout.alioth.debian.org/u32/benchmark.php?test=nbody&lang=java -native "c-stack-cdecl" mod llvm = "" { +native "cdecl" mod llvm = "" { fn sqrt(n: float) -> float; } diff --git a/src/test/compile-fail/native-unsafe-fn-called.rs b/src/test/compile-fail/native-unsafe-fn-called.rs index 1f7aa9129bf..6e9d7ac18fc 100644 --- a/src/test/compile-fail/native-unsafe-fn-called.rs +++ b/src/test/compile-fail/native-unsafe-fn-called.rs @@ -1,6 +1,6 @@ // -*- rust -*- // error-pattern: safe function calls function marked unsafe -native "c-stack-cdecl" mod test { +native "cdecl" mod test { unsafe fn free(); } diff --git a/src/test/compile-fail/native-unsafe-fn.rs b/src/test/compile-fail/native-unsafe-fn.rs index 5f980db30cf..2a2ce4b3246 100644 --- a/src/test/compile-fail/native-unsafe-fn.rs +++ b/src/test/compile-fail/native-unsafe-fn.rs @@ -1,7 +1,7 @@ // -*- rust -*- // error-pattern: unsafe functions can only be called -native "c-stack-cdecl" mod test { +native "cdecl" mod test { unsafe fn free(); } diff --git a/src/test/run-pass/bind-native.rs b/src/test/run-pass/bind-native.rs index e0a191f292c..ecd63a91eeb 100644 --- a/src/test/run-pass/bind-native.rs +++ b/src/test/run-pass/bind-native.rs @@ -2,7 +2,7 @@ Can we bind native things? */ -native "c-stack-cdecl" mod rustrt { +native "cdecl" mod rustrt { fn pin_task(); } diff --git a/src/test/run-pass/binops.rs b/src/test/run-pass/binops.rs index d98e0a3b6a1..2d421947eef 100644 --- a/src/test/run-pass/binops.rs +++ b/src/test/run-pass/binops.rs @@ -117,7 +117,7 @@ fn test_fn() { assert (h1 >= h2); } -native "c-stack-cdecl" mod native_mod = "" { +native "cdecl" mod native_mod = "" { fn do_gc(); fn unsupervise(); } diff --git a/src/test/run-pass/c-stack-as-value.rs b/src/test/run-pass/c-stack-as-value.rs index 0b412e23225..2a13e6d3563 100644 --- a/src/test/run-pass/c-stack-as-value.rs +++ b/src/test/run-pass/c-stack-as-value.rs @@ -1,6 +1,6 @@ // xfail-test -native "c-stack-cdecl" mod rustrt { +native "cdecl" mod rustrt { fn unsupervise(); } diff --git a/src/test/run-pass/c-stack-returning-int64.rs b/src/test/run-pass/c-stack-returning-int64.rs index 13e1ab0de68..27841705047 100644 --- a/src/test/run-pass/c-stack-returning-int64.rs +++ b/src/test/run-pass/c-stack-returning-int64.rs @@ -1,7 +1,7 @@ use std; import std::str; -native "c-stack-cdecl" mod libc = "" { +native "cdecl" mod libc = "" { fn atol(x: str::sbuf) -> int; fn atoll(x: str::sbuf) -> i64; } diff --git a/src/test/run-pass/conditional-compile.rs b/src/test/run-pass/conditional-compile.rs index a8b65e52ef9..10b9dcd9883 100644 --- a/src/test/run-pass/conditional-compile.rs +++ b/src/test/run-pass/conditional-compile.rs @@ -4,13 +4,13 @@ const b: bool = false; const b: bool = true; #[cfg(bogus)] -native "c-stack-cdecl" mod rustrt { +native "cdecl" mod rustrt { // This symbol doesn't exist and would be a link error if this // module was translated fn bogus(); } -native "c-stack-cdecl" mod rustrt { } +native "cdecl" mod rustrt { } #[cfg(bogus)] type t = int; @@ -79,7 +79,7 @@ fn test_in_fn_ctxt() { } mod test_native_items { - native "c-stack-cdecl" mod rustrt { + native "cdecl" mod rustrt { #[cfg(bogus)] fn vec_from_buf_shared<T>(ptr: *T, count: uint) -> [T]; fn vec_from_buf_shared<T>(ptr: *T, count: uint) -> [T]; diff --git a/src/test/run-pass/import-from-native.rs b/src/test/run-pass/import-from-native.rs index 2d8888e81dd..4167f89eaa1 100644 --- a/src/test/run-pass/import-from-native.rs +++ b/src/test/run-pass/import-from-native.rs @@ -3,7 +3,7 @@ mod spam { fn eggs() { } } -native "c-stack-cdecl" mod rustrt { +native "cdecl" mod rustrt { import spam::{ham, eggs}; export ham; export eggs; diff --git a/src/test/run-pass/import-glob-1.rs b/src/test/run-pass/import-glob-1.rs index c2d73f4636c..d9c1b653217 100644 --- a/src/test/run-pass/import-glob-1.rs +++ b/src/test/run-pass/import-glob-1.rs @@ -20,7 +20,7 @@ mod a1 { // | | | mod a2 { // | | | - native "c-stack-cdecl" mod b1 = "" { + native "cdecl" mod b1 = "" { // | | | import a1::b2::*; // | <-/ -/ diff --git a/src/test/run-pass/invoke-external-native.rs b/src/test/run-pass/invoke-external-native.rs index 6234685419b..6851bcd0783 100644 --- a/src/test/run-pass/invoke-external-native.rs +++ b/src/test/run-pass/invoke-external-native.rs @@ -3,7 +3,7 @@ import std::sys; // The purpose of this test is to check that we can -// successfully (and safely) invoke external, c-stack-cdecl +// successfully (and safely) invoke external, cdecl // functions from outside the crate. fn main() { diff --git a/src/test/run-pass/item-attributes.rs b/src/test/run-pass/item-attributes.rs index 2960b9f5ecd..033504e2e0d 100644 --- a/src/test/run-pass/item-attributes.rs +++ b/src/test/run-pass/item-attributes.rs @@ -29,7 +29,7 @@ mod test_single_attr_outer { mod mod1 { } #[attr = "val"] - native "c-stack-cdecl" mod rustrt { } + native "cdecl" mod rustrt { } #[attr = "val"] type t = obj { }; @@ -55,7 +55,7 @@ mod test_multi_attr_outer { #[attr1 = "val"] #[attr2 = "val"] - native "c-stack-cdecl" mod rustrt { } + native "cdecl" mod rustrt { } #[attr1 = "val"] #[attr2 = "val"] @@ -83,7 +83,7 @@ mod test_stmt_single_attr_outer { } #[attr = "val"] - native "c-stack-cdecl" mod rustrt { + native "cdecl" mod rustrt { } */ @@ -116,7 +116,7 @@ mod test_stmt_multi_attr_outer { #[attr1 = "val"] #[attr2 = "val"] - native "c-stack-cdecl" mod rustrt { + native "cdecl" mod rustrt { } */ @@ -182,7 +182,7 @@ mod test_other_forms { } mod test_native_items { - native "c-stack-cdecl" mod rustrt { + native "cdecl" mod rustrt { #[attr]; #[attr] diff --git a/src/test/run-pass/native-mod.rc b/src/test/run-pass/native-mod.rc index 793273b1a09..fe65719092e 100644 --- a/src/test/run-pass/native-mod.rc +++ b/src/test/run-pass/native-mod.rc @@ -10,7 +10,7 @@ native mod libc = target_libc { fn free(int p) -> (); } -native "c-stack-cdecl" mod rustrt { +native "cdecl" mod rustrt { fn str_buf(str s) -> int; } diff --git a/src/test/run-pass/native-opaque-type.rs b/src/test/run-pass/native-opaque-type.rs index 12eec6bc0fc..6ec8b4dba6a 100644 --- a/src/test/run-pass/native-opaque-type.rs +++ b/src/test/run-pass/native-opaque-type.rs @@ -1,6 +1,6 @@ -native "c-stack-cdecl" mod libc = "" { +native "cdecl" mod libc = "" { type file_handle; } diff --git a/src/test/run-pass/native.rc b/src/test/run-pass/native.rc index 6b16987bf9b..18993397002 100644 --- a/src/test/run-pass/native.rc +++ b/src/test/run-pass/native.rc @@ -1,7 +1,7 @@ // xfail-test // -*- rust -*- -native "c-stack-cdecl" mod rustrt { +native "cdecl" mod rustrt { fn str_buf(str s) -> int; } diff --git a/src/test/run-pass/native2.rs b/src/test/run-pass/native2.rs index c3dcf902521..03b0038c0d6 100644 --- a/src/test/run-pass/native2.rs +++ b/src/test/run-pass/native2.rs @@ -1,17 +1,17 @@ -native "c-stack-cdecl" mod rustrt { +native "cdecl" mod rustrt { fn unsupervise(); } -native "c-stack-cdecl" mod bar = "" { } +native "cdecl" mod bar = "" { } -native "c-stack-cdecl" mod zed = "" { } +native "cdecl" mod zed = "" { } -native "c-stack-cdecl" mod libc = "" { +native "cdecl" mod libc = "" { fn write(fd: int, buf: *u8, count: uint) -> int; } -native "c-stack-cdecl" mod baz = "" { } +native "cdecl" mod baz = "" { } fn main(args: [str]) { } |
