summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/codegen/helpers.rs16
-rw-r--r--src/features.rs2
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;
}
);