about summary refs log tree commit diff
path: root/src/libfourcc
diff options
context:
space:
mode:
authorYuri Kunde Schlesner <yuriks@yuriks.net>2014-02-06 17:41:49 -0200
committerDerek Guenther <dguenther9@gmail.com>2014-02-08 23:40:17 -0600
commit6381daab773ca97ef6553d4d244cc9a8f49475a4 (patch)
tree9649aa6e4964251261ed133bdc5f6f75b3ac867d /src/libfourcc
parent97078d43b20abc7510fde2e400500fed4c8b1eb3 (diff)
downloadrust-6381daab773ca97ef6553d4d244cc9a8f49475a4.tar.gz
rust-6381daab773ca97ef6553d4d244cc9a8f49475a4.zip
Default fourcc! to big-endian.
It was decided that a consistent result across platforms would be the
most useful and least surprising. A "target" option has been added to
get the old behaviour of using the target platform's endianess.
Diffstat (limited to 'src/libfourcc')
-rw-r--r--src/libfourcc/lib.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libfourcc/lib.rs b/src/libfourcc/lib.rs
index aae47b87f07..2b017b501c9 100644
--- a/src/libfourcc/lib.rs
+++ b/src/libfourcc/lib.rs
@@ -76,10 +76,11 @@ pub fn expand_syntax_ext(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree]) ->
     let (expr, endian) = parse_tts(cx, tts);
 
     let little = match endian {
-        None => target_endian_little(cx, sp),
+        None => false,
         Some(Ident{ident, span}) => match token::get_ident(ident.name).get() {
             "little" => true,
             "big" => false,
+            "target" => target_endian_little(cx, sp),
             _ => {
                 cx.span_err(span, "invalid endian directive in fourcc!");
                 target_endian_little(cx, sp)