diff options
author | Christian Poveda <christian.poveda@ferrous-systems.com> | 2022-09-07 15:37:48 -0500 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2022-09-22 21:18:25 -1000 |
commit | 3ec5c8746204ad82bfbf0239d3e9d95d92c2e331 (patch) | |
tree | d31b152420e2fb41987f9394aee2799aa921b037 /src | |
parent | c84897d33846b4cf0d8494e20326cbc6fc3bb0d8 (diff) |
use `#[feature(core_ffi_c)]` when available
Diffstat (limited to 'src')
-rw-r--r-- | src/codegen/helpers.rs | 16 | ||||
-rw-r--r-- | src/features.rs | 2 |
2 files changed, 15 insertions, 3 deletions
diff --git a/src/codegen/helpers.rs b/src/codegen/helpers.rs index 75c169c6..5bf36acb 100644 --- a/src/codegen/helpers.rs +++ b/src/codegen/helpers.rs @@ -166,9 +166,19 @@ pub mod ast_ty { #prefix::#ident } } - None => quote! { - ::std::os::raw::#ident - }, + None => { + if ctx.options().use_core && + ctx.options().rust_features().core_ffi_c + { + quote! { + ::core::ffi::#ident + } + } else { + quote! { + ::std::os::raw::#ident + } + } + } } } diff --git a/src/features.rs b/src/features.rs index 59467703..f18ffa88 100644 --- a/src/features.rs +++ b/src/features.rs @@ -130,6 +130,7 @@ macro_rules! rust_target_base { /// Nightly rust /// * `thiscall` calling convention ([Tracking issue](https://github.com/rust-lang/rust/issues/42202)) /// * `vectorcall` calling convention (no tracking issue) + /// * `core_ffi_c` ([Tracking issue](https://github.com/rust-lang/rust/issues/94501)) => Nightly => nightly; ); } @@ -236,6 +237,7 @@ rust_feature_def!( Nightly { => thiscall_abi; => vectorcall_abi; + => core_ffi_c; } ); |