Skip to content

Commit

Permalink
Merge pull request #672 from Amjad50/fix-weak-linkage
Browse files Browse the repository at this point in the history
Fix weak linkage on windows and apple platforms
  • Loading branch information
tgross35 authored Aug 22, 2024
2 parents d96d3a7 + 6651d11 commit be4374f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ macro_rules! intrinsics {
#[cfg(all(any(windows, target_os = "uefi"), target_arch = "x86_64", not(feature = "mangled-names")))]
mod $name {
#[no_mangle]
#[cfg_attr(all(not(windows), not(target_vendor = "apple")), linkage = "weak")]
#[cfg_attr(not(all(windows, target_env = "gnu")), linkage = "weak")]
extern $abi fn $name( $($argname: $ty),* )
-> $crate::macros::win64_128bit_abi_hack::U64x2
{
Expand Down Expand Up @@ -298,7 +298,7 @@ macro_rules! intrinsics {
#[cfg(all(target_arch = "arm", not(feature = "mangled-names")))]
mod $name {
#[no_mangle]
#[cfg_attr(all(not(windows), not(target_vendor = "apple")), linkage = "weak")]
#[cfg_attr(not(all(windows, target_env = "gnu")), linkage = "weak")]
$(#[$($attr)*])*
extern $abi fn $name( $($argname: $ty),* ) $(-> $ret)? {
super::$name($($argname),*)
Expand All @@ -308,7 +308,7 @@ macro_rules! intrinsics {
#[cfg(all(target_arch = "arm", not(feature = "mangled-names")))]
mod $alias {
#[no_mangle]
#[cfg_attr(all(not(windows), not(target_vendor="apple")), linkage = "weak")]
#[cfg_attr(not(all(windows, target_env = "gnu")), linkage = "weak")]
$(#[$($attr)*])*
extern "aapcs" fn $alias( $($argname: $ty),* ) $(-> $ret)? {
super::$name($($argname),*)
Expand Down Expand Up @@ -375,7 +375,7 @@ macro_rules! intrinsics {
mod $name {
$(#[$($attr)*])*
#[no_mangle]
#[cfg_attr(all(not(windows), not(target_vendor = "apple")), linkage = "weak")]
#[cfg_attr(not(all(windows, target_env = "gnu")), linkage = "weak")]
unsafe extern $abi fn $name( $($argname: $ty),* ) $(-> $ret)? {
super::$name($($argname),*)
}
Expand All @@ -400,7 +400,7 @@ macro_rules! intrinsics {
#[naked]
$(#[$($attr)*])*
#[cfg_attr(not(feature = "mangled-names"), no_mangle)]
#[cfg_attr(all(not(windows), not(target_vendor = "apple")), linkage = "weak")]
#[cfg_attr(not(all(windows, target_env = "gnu")), linkage = "weak")]
pub unsafe extern $abi fn $name( $($argname: $ty),* ) $(-> $ret)? {
$($body)*
}
Expand Down Expand Up @@ -467,7 +467,7 @@ macro_rules! intrinsics {
mod $name {
$(#[$($attr)*])*
#[no_mangle]
#[cfg_attr(all(not(windows), not(target_vendor = "apple")), linkage = "weak")]
#[cfg_attr(not(all(windows, target_env = "gnu")), linkage = "weak")]
$(unsafe $($empty)?)? extern $abi fn $name( $($argname: $ty),* ) $(-> $ret)? {
super::$name($($argname),*)
}
Expand Down

0 comments on commit be4374f

Please sign in to comment.