File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -761,7 +761,7 @@ impl Default for TargetOptions {
761761}
762762
763763impl 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.
765765 pub fn adjust_abi ( & self , abi : Abi ) -> Abi {
766766 match abi {
767767 Abi :: System => {
@@ -771,6 +771,16 @@ impl Target {
771771 Abi :: C
772772 }
773773 } ,
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+ } ,
774784 abi => abi
775785 }
776786 }
You can’t perform that action at this time.
0 commit comments