Skip to content

Commit 30db623

Browse files
yuriksdguenther
authored andcommitted
---
yaml --- r: 104005 b: refs/heads/try c: 6381daa h: refs/heads/master i: 104003: f2d1acd v: v3
1 parent 5012092 commit 30db623

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 62f1d68439dcfd509eaca29887afa97f22938373
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6e7f170fedd3c526a643c0b2d13863acd982be02
5-
refs/heads/try: 97078d43b20abc7510fde2e400500fed4c8b1eb3
5+
refs/heads/try: 6381daab773ca97ef6553d4d244cc9a8f49475a4
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/libfourcc/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,11 @@ pub fn expand_syntax_ext(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree]) ->
7676
let (expr, endian) = parse_tts(cx, tts);
7777

7878
let little = match endian {
79-
None => target_endian_little(cx, sp),
79+
None => false,
8080
Some(Ident{ident, span}) => match token::get_ident(ident.name).get() {
8181
"little" => true,
8282
"big" => false,
83+
"target" => target_endian_little(cx, sp),
8384
_ => {
8485
cx.span_err(span, "invalid endian directive in fourcc!");
8586
target_endian_little(cx, sp)

branches/try/src/test/run-pass-fulldeps/syntax-extension-fourcc.rs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,25 @@
1919
extern mod fourcc;
2020

2121
static static_val: u32 = fourcc!("foo ");
22-
static static_val_le: u32 = fourcc!("foo ", little);
2322
static static_val_be: u32 = fourcc!("foo ", big);
23+
static static_val_le: u32 = fourcc!("foo ", little);
24+
static static_val_target: u32 = fourcc!("foo ", target);
2425

2526
fn main() {
26-
let val = fourcc!("foo ");
27-
let exp = if cfg!(target_endian = "big") { 0x666f6f20u32 } else { 0x206f6f66u32 };
28-
assert_eq!(val, exp);
29-
3027
let val = fourcc!("foo ", big);
3128
assert_eq!(val, 0x666f6f20u32);
29+
assert_eq!(val, fourcc!("foo "));
3230

3331
let val = fourcc!("foo ", little);
3432
assert_eq!(val, 0x206f6f66u32);
3533

34+
let val = fourcc!("foo ", target);
3635
let exp = if cfg!(target_endian = "big") { 0x666f6f20u32 } else { 0x206f6f66u32 };
37-
assert_eq!(static_val, exp);
38-
assert_eq!(static_val_le, 0x206f6f66u32);
36+
assert_eq!(val, exp);
37+
3938
assert_eq!(static_val_be, 0x666f6f20u32);
39+
assert_eq!(static_val, static_val_be);
40+
assert_eq!(static_val_le, 0x206f6f66u32);
41+
let exp = if cfg!(target_endian = "big") { 0x666f6f20u32 } else { 0x206f6f66u32 };
42+
assert_eq!(static_val_target, exp);
4043
}

0 commit comments

Comments
 (0)