Add placeholder for cbindgen proc_macro_attribute

This commit is contained in:
Jakub Konka
2019-05-14 07:57:04 +02:00
committed by Dan Gohman
parent eb1cf8b0a1
commit e552b19dfe
4 changed files with 37 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
extern crate proc_macro;
use proc_macro::TokenStream;
use quote::quote;
use syn::{FnArg, ArgCaptured, Pat, PatIdent};
use std::collections::HashMap;
#[proc_macro_attribute]
pub fn wasi_common_cbindgen(attr: TokenStream, function: TokenStream) -> TokenStream {
assert!(attr.is_empty());
let function = syn::parse_macro_input!(function as syn::ItemFn);
let result = quote! {
#function
};
result.into()
}