mirror of
https://github.com/openharmony/third_party_rust_linux-raw-sys.git
synced 2026-07-19 21:24:35 -04:00
Add a "std" feature to be friendlier for cargo nono.
This commit is contained in:
@@ -30,8 +30,9 @@ jobs:
|
||||
cargo check --features v5_4
|
||||
cargo check --features v5_11
|
||||
cargo check --features "v3_2 netlink"
|
||||
cargo check --no-default-features --features "v5_11 netlink"
|
||||
cargo check --features no_std
|
||||
cargo check --no-default-features --features "std v5_11 netlink"
|
||||
cargo check --no-default-features --features "no_std v5_4 netlink"
|
||||
cargo check --no-default-features --features "no_std general errno"
|
||||
|
||||
gen:
|
||||
name: Update generated files
|
||||
|
||||
+2
-1
@@ -31,5 +31,6 @@ v4_4 = []
|
||||
v4_20 = []
|
||||
v5_4 = []
|
||||
v5_11 = []
|
||||
default = ["general", "errno"]
|
||||
default = ["std", "general", "errno"]
|
||||
std = []
|
||||
no_std = ['cty']
|
||||
|
||||
+2
-1
@@ -239,7 +239,8 @@ fn main() {
|
||||
}
|
||||
}
|
||||
|
||||
writeln!(cargo_toml, "default = [{}]", DEFAULT_FEATURES).unwrap();
|
||||
writeln!(cargo_toml, "default = [\"std\", {}]", DEFAULT_FEATURES).unwrap();
|
||||
writeln!(cargo_toml, "std = []").unwrap();
|
||||
writeln!(cargo_toml, "no_std = ['cty']").unwrap();
|
||||
|
||||
// Reset the `linux` directory back to the original branch.
|
||||
|
||||
+2
-4
@@ -1,9 +1,7 @@
|
||||
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)]
|
||||
#![no_std]
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
#[cfg(not(feature = "no_std"))]
|
||||
extern crate std;
|
||||
#[cfg(not(feature = "no_std"))]
|
||||
#[cfg(feature = "std")]
|
||||
use std::os::raw as ctypes;
|
||||
|
||||
#[cfg(feature = "no_std")]
|
||||
|
||||
Reference in New Issue
Block a user