outlook_mapi_macros/
lib.rs1#[macro_export]
6macro_rules! impl_sized_struct_casts {
7 ($name:ident, $sys_type:path) => {
8 #[allow(dead_code)]
9 impl $name {
10 pub fn as_ptr(&self) -> *const $sys_type {
11 unsafe { std::mem::transmute::<&Self, &$sys_type>(self) }
12 }
13
14 pub fn as_mut_ptr(&mut self) -> *mut $sys_type {
15 unsafe { std::mem::transmute::<&mut Self, &mut $sys_type>(self) }
16 }
17 }
18 };
19}
20
21#[macro_export]
23macro_rules! impl_sized_struct_default {
24 ($name:ident $body:tt) => {
25 #[allow(dead_code)]
26 impl Default for $name {
27 fn default() -> Self {
28 Self $body
29 }
30 }
31 };
32}
33
34#[macro_export]
36macro_rules! display_table_default_flags {
37 (u8, $unicode:expr) => {
38 0
39 };
40 (u16, $unicode:expr) => {
41 $unicode
42 };
43}