mirror of
https://github.com/openharmony/third_party_rust_linux-raw-sys.git
synced 2026-07-18 18:24:28 -04:00
Use rustc-std-workspace-core like libc does.
This commit is contained in:
+2
-2
@@ -12,7 +12,7 @@ categories = ["external-ffi-bindings"]
|
||||
exclude = ["gen"]
|
||||
|
||||
[dependencies]
|
||||
core = { version = "1.0.0", optional = true, package = "rustc-std-workspace-core" }
|
||||
rustc-std-workspace-core = { version = "1.0.0", optional = true }
|
||||
compiler_builtins = { version = '0.1.49', optional = true }
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
@@ -35,4 +35,4 @@ v5_11 = []
|
||||
default = ["std", "general", "errno"]
|
||||
std = []
|
||||
no_std = []
|
||||
rustc-dep-of-std = ["core", "compiler_builtins", "no_std"]
|
||||
rustc-dep-of-std = ["rustc-std-workspace-core", "compiler_builtins", "no_std"]
|
||||
|
||||
+1
-1
@@ -242,7 +242,7 @@ fn main() {
|
||||
writeln!(cargo_toml, "default = [\"std\", {}]", DEFAULT_FEATURES).unwrap();
|
||||
writeln!(cargo_toml, "std = []").unwrap();
|
||||
writeln!(cargo_toml, "no_std = []").unwrap();
|
||||
writeln!(cargo_toml, "rustc-dep-of-std = [\"core\", \"compiler_builtins\", \"no_std\"]").unwrap();
|
||||
writeln!(cargo_toml, "rustc-dep-of-std = [\"rustc-std-workspace-core\", \"compiler_builtins\", \"no_std\"]").unwrap();
|
||||
|
||||
// Reset the `linux` directory back to the original branch.
|
||||
git_checkout(LINUX_VERSIONS[0]);
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)]
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
#[cfg(feature = "rustc-dep-of-std")]
|
||||
extern crate rustc_std_workspace_core as core;
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
pub use std::os::raw as ctypes;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user