Created
August 19, 2020 13:57
-
-
Save jakerr/231dee4a138f7a5f25148ea8f39b382e to your computer and use it in GitHub Desktop.
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
extern crate proc_macro; | |
use proc_macro::TokenStream; | |
#[proc_macro_attribute] | |
pub fn if_mac_or_win_cfg(_attr: TokenStream, item: TokenStream) -> TokenStream { | |
let mut stream = "#[cfg(any(target_os = \"macosx\", target_os = \"windows\"))]".parse::<TokenStream>().unwrap(); | |
stream.extend(item); | |
stream | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment