33 lines
830 B
Rust
33 lines
830 B
Rust
#![no_std] #![feature(decl_macro)] #![allow(unused)]
|
|
|
|
|
|
macro_rules! import {
|
|
($module:ident, $name:ident) => {
|
|
pub use $module::prelude::*;
|
|
pub use $module::public as $name;
|
|
};
|
|
($module:ident, $name:ident, $feature:literal) => {
|
|
#[cfg(feature = $feature)]
|
|
pub use $module::prelude::*;
|
|
#[cfg(feature = $feature)]
|
|
pub use $module::public as $name;
|
|
};
|
|
}
|
|
|
|
import!(sub_core, core, "core");
|
|
import!(sub_libm, libm, "libm");
|
|
import!(sub_pe, pe, "pe");
|
|
import!(sub_winu, win, "winuser");
|
|
import!(sub_xpat, xpat, "xpat");
|
|
|
|
/// the macro crate is a proc macro, so it is a bit different.
|
|
#[cfg(feature = "macros")]
|
|
pub use sub_macros::{
|
|
FromRepr
|
|
};
|
|
|
|
#[cfg(feature = "macros")]
|
|
pub trait FromRepr: Sized {
|
|
type Repr;
|
|
fn from_repr(repr: Self::Repr) -> Option<Self>;
|
|
} |