Skip to content

Commit f636595

Browse files
yuriksdguenther
authored andcommitted
---
yaml --- r: 149027 b: refs/heads/try2 c: 6381daa h: refs/heads/master i: 149025: 67e086a 149023: 2e87924 v: v3
1 parent d35d88c commit f636595

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
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 97078d43b20abc7510fde2e400500fed4c8b1eb3
8+
refs/heads/try2: 6381daab773ca97ef6553d4d244cc9a8f49475a4
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/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/try2/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)