File tree 2 files changed +14
-3
lines changed 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -761,7 +761,7 @@ impl Default for TargetOptions {
761
761
}
762
762
763
763
impl Target {
764
- /// Given a function ABI, turn "System" into the correct ABI for this target.
764
+ /// Given a function ABI, turn it into the correct ABI for this target.
765
765
pub fn adjust_abi ( & self , abi : Abi ) -> Abi {
766
766
match abi {
767
767
Abi :: System => {
@@ -771,6 +771,16 @@ impl Target {
771
771
Abi :: C
772
772
}
773
773
} ,
774
+ // These ABI kinds are ignored on non-x86 Windows targets.
775
+ // See https://docs.microsoft.com/en-us/cpp/cpp/argument-passing-and-naming-conventions
776
+ // and the individual pages for __stdcall et al.
777
+ Abi :: Stdcall | Abi :: Fastcall | Abi :: Vectorcall | Abi :: Thiscall => {
778
+ if self . options . is_like_windows && self . arch != "x86" {
779
+ Abi :: C
780
+ } else {
781
+ abi
782
+ }
783
+ } ,
774
784
abi => abi
775
785
}
776
786
}
Original file line number Diff line number Diff line change 8
8
// option. This file may not be copied, modified, or distributed
9
9
// except according to those terms.
10
10
11
- // ignore-arm
12
- // ignore-aarch64
11
+ // Test that `extern "stdcall"` is properly translated.
12
+
13
+ // only-x86
13
14
14
15
// compile-flags: -C no-prepopulate-passes
15
16
You can’t perform that action at this time.
0 commit comments