File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 1+ /// Define a type's implementation of [StaticReflect](crate::StaticReflect) as an extern type
2+ ///
3+ /// See [TypeInfo::Extern](crate::types::TypeInfo::Extern)
4+ #[ macro_export]
5+ macro_rules! define_extern_type {
6+ ( $target: ident) => ( define_extern_type!( $target => $target) ; ) ;
7+ ( $target: ty => $defined_path: path) => {
8+ impl :: static_reflect:: StaticReflect for $target {
9+ const TYPE_INFO : $crate:: TypeInfo <' static > = $crate:: TypeInfo :: Extern {
10+ name: stringify!( $defined_path)
11+ } ;
12+ }
13+ } ;
14+ }
115
216/// Get the integer offset of the specified field
317#[ macro_export]
@@ -12,4 +26,4 @@ macro_rules! field_offset {
1226 ( std:: ptr:: addr_of!( ( * ( 1 as * mut $target) ) $( . $field) * ) as usize ) - 1
1327 }
1428 }
15- }
29+ }
You can’t perform that action at this time.
0 commit comments