osom_lib_reprc_proc_macros/lib.rs
1//! A private crate that exposes macros for osom_lib_reprc crate.
2#![deny(warnings)]
3#![allow(unused_features)]
4#![doc(hidden)]
5#![warn(clippy::all, clippy::pedantic)]
6
7use proc_macro::TokenStream;
8
9mod reprc_impl;
10
11/// This macro attribute applies `#[repr(C)]` to the struct/enum,
12/// implements the `ReprC` trait and ensure that each field is also
13/// `ReprC`.
14#[proc_macro_attribute]
15pub fn reprc(attr: TokenStream, item: TokenStream) -> TokenStream {
16 reprc_impl::reprc_impl(attr.into(), item.into()).into()
17}