Created
March 9, 2016 21:02
-
-
Save kestein/50a2c175d35bc1c5a4b0 to your computer and use it in GitHub Desktop.
Rust conditional compile blocks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(stmt_expr_attributes)] // Need this in order to put the #[cfg] around a block | |
fn main() { | |
#[cfg(not(windows))] // Applies to the entire block OR the line directly after it | |
{ | |
println!("HAHA, WINDOWS NERD"); | |
println!("Richard Stallman > Bill Gates"); | |
} | |
println!("All done."); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment