Merge pull request #642 from tgross35/android-testing-fix
Fix missing `extern "C"` on `unsafe` intrinsics
This commit is contained in:
commit
e01e62aa16
1 changed files with 3 additions and 30 deletions
|
|
@ -449,14 +449,14 @@ macro_rules! intrinsics {
|
|||
// input we were given.
|
||||
(
|
||||
$(#[$($attr:tt)*])*
|
||||
pub extern $abi:tt fn $name:ident( $($argname:ident: $ty:ty),* ) $(-> $ret:ty)? {
|
||||
pub $(unsafe $(@ $empty:tt)?)? extern $abi:tt fn $name:ident( $($argname:ident: $ty:ty),* ) $(-> $ret:ty)? {
|
||||
$($body:tt)*
|
||||
}
|
||||
|
||||
$($rest:tt)*
|
||||
) => (
|
||||
$(#[$($attr)*])*
|
||||
pub extern $abi fn $name( $($argname: $ty),* ) $(-> $ret)? {
|
||||
pub $(unsafe $($empty)?)? extern $abi fn $name( $($argname: $ty),* ) $(-> $ret)? {
|
||||
$($body)*
|
||||
}
|
||||
|
||||
|
|
@ -465,34 +465,7 @@ macro_rules! intrinsics {
|
|||
$(#[$($attr)*])*
|
||||
#[no_mangle]
|
||||
#[cfg_attr(all(not(windows), not(target_vendor = "apple")), linkage = "weak")]
|
||||
extern $abi fn $name( $($argname: $ty),* ) $(-> $ret)? {
|
||||
super::$name($($argname),*)
|
||||
}
|
||||
}
|
||||
|
||||
intrinsics!($($rest)*);
|
||||
);
|
||||
|
||||
// Same as the above for unsafe functions.
|
||||
(
|
||||
$(#[$($attr:tt)*])*
|
||||
pub unsafe extern $abi:tt fn $name:ident( $($argname:ident: $ty:ty),* ) $(-> $ret:ty)? {
|
||||
$($body:tt)*
|
||||
}
|
||||
|
||||
$($rest:tt)*
|
||||
) => (
|
||||
$(#[$($attr)*])*
|
||||
pub unsafe extern $abi fn $name( $($argname: $ty),* ) $(-> $ret)? {
|
||||
$($body)*
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "mangled-names"))]
|
||||
mod $name {
|
||||
$(#[$($attr)*])*
|
||||
#[no_mangle]
|
||||
#[cfg_attr(all(not(windows), not(target_vendor = "apple")), linkage = "weak")]
|
||||
unsafe fn $name( $($argname: $ty),* ) $(-> $ret)? {
|
||||
$(unsafe $($empty)?)? extern $abi fn $name( $($argname: $ty),* ) $(-> $ret)? {
|
||||
super::$name($($argname),*)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue