@@ -449,41 +449,14 @@ macro_rules! intrinsics {
449449 // input we were given.
450450 (
451451 $( #[ $( $attr: tt) * ] ) *
452- pub extern $abi: tt fn $name: ident( $( $argname: ident: $ty: ty) ,* ) $( -> $ret: ty) ? {
453- $( $body: tt) *
454- }
455-
456- $( $rest: tt) *
457- ) => (
458- $( #[ $( $attr) * ] ) *
459- pub extern $abi fn $name( $( $argname: $ty) ,* ) $( -> $ret) ? {
460- $( $body) *
461- }
462-
463- #[ cfg( not( feature = "mangled-names" ) ) ]
464- mod $name {
465- $( #[ $( $attr) * ] ) *
466- #[ no_mangle]
467- #[ cfg_attr( all( not( windows) , not( target_vendor = "apple" ) ) , linkage = "weak" ) ]
468- extern $abi fn $name( $( $argname: $ty) ,* ) $( -> $ret) ? {
469- super :: $name( $( $argname) ,* )
470- }
471- }
472-
473- intrinsics!( $( $rest) * ) ;
474- ) ;
475-
476- // Same as the above for unsafe functions.
477- (
478- $( #[ $( $attr: tt) * ] ) *
479- pub unsafe extern $abi: tt fn $name: ident( $( $argname: ident: $ty: ty) ,* ) $( -> $ret: ty) ? {
452+ pub $( unsafe $( @ $empty: tt) ?) ? extern $abi: tt fn $name: ident( $( $argname: ident: $ty: ty) ,* ) $( -> $ret: ty) ? {
480453 $( $body: tt) *
481454 }
482455
483456 $( $rest: tt) *
484457 ) => (
485458 $( #[ $( $attr) * ] ) *
486- pub unsafe extern $abi fn $name( $( $argname: $ty) ,* ) $( -> $ret) ? {
459+ pub $ ( unsafe $ ( $empty ) ? ) ? extern $abi fn $name( $( $argname: $ty) ,* ) $( -> $ret) ? {
487460 $( $body) *
488461 }
489462
@@ -492,7 +465,7 @@ macro_rules! intrinsics {
492465 $( #[ $( $attr) * ] ) *
493466 #[ no_mangle]
494467 #[ cfg_attr( all( not( windows) , not( target_vendor = "apple" ) ) , linkage = "weak" ) ]
495- unsafe fn $name( $( $argname: $ty) ,* ) $( -> $ret) ? {
468+ $ ( unsafe $ ( $empty ) ? ) ? extern $abi fn $name( $( $argname: $ty) ,* ) $( -> $ret) ? {
496469 super :: $name( $( $argname) ,* )
497470 }
498471 }
0 commit comments