Skip to content

Commit 4eaa658

Browse files
committed
Don't depend on libc for cfg(windows)
1 parent e0d996f commit 4eaa658

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ members = [
88
"crates/stdarch-gen-loongarch",
99
"crates/intrinsic-test",
1010
"examples/"
11-
]
11+
, "crates/maybelibc"]
1212
exclude = [
1313
"crates/wasm-assert-instr-tests"
1414
]

crates/maybelibc/Cargo.toml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[package]
2+
name = "maybelibc"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
[target.'cfg(not(windows))'.dependencies]
7+
libc = { version = "0.2", default-features = false }

crates/maybelibc/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#[cfg(not(windows))]
2+
pub use libc::*;

crates/std_detect/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ is-it-maintained-open-issues = { repository = "rust-lang/stdarch" }
2121
maintenance = { status = "experimental" }
2222

2323
[dependencies]
24-
libc = { version = "0.2", optional = true, default-features = false }
24+
libc = { package = "maybelibc", path = "../maybelibc", version = "0.1", optional = true }
2525
cfg-if = "1.0.0"
2626

2727
# When built as part of libstd

0 commit comments

Comments
 (0)