@@ -1945,6 +1945,10 @@ impl MethodCodegen for Method {
1945
1945
_ => panic ! ( "How in the world?" ) ,
1946
1946
} ;
1947
1947
1948
+ if let ( Abi :: ThisCall , false ) = ( signature. abi ( ) , ctx. options ( ) . rust_features ( ) . thiscall_abi ( ) ) {
1949
+ return ;
1950
+ }
1951
+
1948
1952
// Do not generate variadic methods, since rust does not allow
1949
1953
// implementing them, and we don't do a good job at it anyway.
1950
1954
if signature. is_variadic ( ) {
@@ -3058,9 +3062,17 @@ impl TryToRustTy for FunctionSig {
3058
3062
let arguments = utils:: fnsig_arguments ( ctx, & self ) ;
3059
3063
let abi = self . abi ( ) ;
3060
3064
3061
- Ok ( quote ! {
3062
- unsafe extern #abi fn ( #( #arguments ) , * ) #ret
3063
- } )
3065
+ match abi {
3066
+ Abi :: ThisCall if !ctx. options ( ) . rust_features ( ) . thiscall_abi ( ) => {
3067
+ warn ! ( "Skipping function with thiscall ABI that isn't supported by the configured Rust target" ) ;
3068
+ Ok ( quote:: Tokens :: new ( ) )
3069
+ }
3070
+ _ => {
3071
+ Ok ( quote ! {
3072
+ unsafe extern #abi fn ( #( #arguments ) , * ) #ret
3073
+ } )
3074
+ }
3075
+ }
3064
3076
}
3065
3077
}
3066
3078
@@ -3132,6 +3144,10 @@ impl CodeGenerator for Function {
3132
3144
}
3133
3145
3134
3146
let abi = match signature. abi ( ) {
3147
+ Abi :: ThisCall if !ctx. options ( ) . rust_features ( ) . thiscall_abi ( ) => {
3148
+ warn ! ( "Skipping function with thiscall ABI that isn't supported by the configured Rust target" ) ;
3149
+ return ;
3150
+ }
3135
3151
Abi :: Unknown ( unknown_abi) => {
3136
3152
panic ! (
3137
3153
"Invalid or unknown abi {:?} for function {:?} ({:?})" ,
0 commit comments