diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2017-10-10 12:41:38 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-10 12:41:38 -0500 |
commit | c744e684470f6b54c4f77ce9ba27f7ce74df892d (patch) | |
tree | 344b3d0c2b80089c3ccbd1607e8dfd094d514ade /src/ir/function.rs | |
parent | 5dbdadc5cc1d15e23d804b4d0ce80cae90338ef7 (diff) | |
parent | 9b95ce6a76d32a1c152bd3719d6cf46dd872b630 (diff) |
Auto merge of #1065 - liranringel:thiscall, r=fitzgen
Add support for the thiscall ABI
Fixes https://github.com/rust-lang-nursery/rust-bindgen/issues/541
The thiscall ABI is experimental, so in order to use it nightly is required and also the following statement:
`#![feature(abi_thiscall)]`
That's a problem because the `tests_expectations` crate (in the tests folder) tries to compile it (and stable is required).
Diffstat (limited to 'src/ir/function.rs')
-rw-r--r-- | src/ir/function.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ir/function.rs b/src/ir/function.rs index b637f9f1..2eab6638 100644 --- a/src/ir/function.rs +++ b/src/ir/function.rs @@ -142,6 +142,8 @@ pub enum Abi { Stdcall, /// The "fastcall" ABI. Fastcall, + /// The "thiscall" ABI. + ThisCall, /// The "aapcs" ABI. Aapcs, /// The "win64" ABI. @@ -166,6 +168,7 @@ impl quote::ToTokens for Abi { Abi::C => quote! { "C" }, Abi::Stdcall => quote! { "stdcall" }, Abi::Fastcall => quote! { "fastcall" }, + Abi::ThisCall => quote! { "thiscall" }, Abi::Aapcs => quote! { "aapcs" }, Abi::Win64 => quote! { "win64" }, Abi::Unknown(cc) => panic!( @@ -200,6 +203,7 @@ fn get_abi(cc: CXCallingConv) -> Abi { CXCallingConv_C => Abi::C, CXCallingConv_X86StdCall => Abi::Stdcall, CXCallingConv_X86FastCall => Abi::Fastcall, + CXCallingConv_X86ThisCall => Abi::ThisCall, CXCallingConv_AAPCS => Abi::Aapcs, CXCallingConv_X86_64Win64 => Abi::Win64, other => Abi::Unknown(other), |