File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,35 @@ macro_rules! public_test_dep {
61
61
macro_rules! intrinsics {
62
62
( ) => ( ) ;
63
63
64
+ // Support cfg_attr:
65
+ (
66
+ #[ cfg_attr( $e: meta, $( $attr: tt) * ) ]
67
+ $( #[ $( $attrs: tt) * ] ) *
68
+ pub extern $abi: tt fn $name: ident( $( $argname: ident: $ty: ty) ,* ) $( -> $ret: ty) ? {
69
+ $( $body: tt) *
70
+ }
71
+ $( $rest: tt) *
72
+ ) => (
73
+ #[ cfg( $e) ]
74
+ intrinsics! {
75
+ #[ $( $attr) * ]
76
+ $( #[ $( $attrs) * ] ) *
77
+ pub extern $abi fn $name( $( $argname: $ty) ,* ) $( -> $ret) ? {
78
+ $( $body) *
79
+ }
80
+ }
81
+
82
+ #[ cfg( not( $e) ) ]
83
+ intrinsics! {
84
+ $( #[ $( $attrs) * ] ) *
85
+ pub extern $abi fn $name( $( $argname: $ty) ,* ) $( -> $ret) ? {
86
+ $( $body) *
87
+ }
88
+ }
89
+
90
+ intrinsics!( $( $rest) * ) ;
91
+ ) ;
92
+
64
93
// Right now there's a bunch of architecture-optimized intrinsics in the
65
94
// stock compiler-rt implementation. Not all of these have been ported over
66
95
// to Rust yet so when the `c` feature of this crate is enabled we fall back
You can’t perform that action at this time.
0 commit comments