1
Fork 0

auto merge of #12196 : dguenther/rust/fix-fourcc-example, r=alexcrichton

Cleans up a few issues with `fourcc`:
* Corrects the endianness in the docs example
* Removes `#[cfg(not(test))]` (bors might not build this on Windows. If the build fails, I'll re-add it)
* Adds a FIXME referencing the LLVM assert issue we encountered with bors builds on Windows (Same error as #10872)
This commit is contained in:
bors 2014-02-12 06:21:44 -08:00
commit d394a48e73

View file

@ -26,10 +26,10 @@ To load the extension and use it:
extern mod fourcc; extern mod fourcc;
fn main() { fn main() {
let val = fourcc!("\xC0\xFF\xEE!") let val = fourcc!("\xC0\xFF\xEE!");
// val is 0xC0FFEE21 assert_eq!(val, 0xC0FFEE21u32);
let big_val = fourcc!("foo ", big); let little_val = fourcc!("foo ", little);
// big_val is 0x21EEFFC0 assert_eq!(little_val, 0x21EEFFC0u32);
} }
``` ```
@ -60,7 +60,6 @@ use syntax::parse::token;
use syntax::parse::token::InternedString; use syntax::parse::token::InternedString;
#[macro_registrar] #[macro_registrar]
#[cfg(not(test))]
pub fn macro_registrar(register: |Name, SyntaxExtension|) { pub fn macro_registrar(register: |Name, SyntaxExtension|) {
register(token::intern("fourcc"), register(token::intern("fourcc"),
NormalTT(~BasicMacroExpander { NormalTT(~BasicMacroExpander {
@ -155,6 +154,6 @@ fn target_endian_little(cx: &ExtCtxt, sp: Span) -> bool {
contains(cx.cfg(), meta) contains(cx.cfg(), meta)
} }
// Fixes LLVM assert on Windows // FIXME (10872): This is required to prevent an LLVM assert on Windows
#[test] #[test]
fn dummy_test() { } fn dummy_test() { }